Memcached 1.6 puts binary protocol to bed

Memcached 1.6 puts binary protocol to bed

The community behind distributed memory object caching system memcached has put the finishing touches to its meta protocol, spurring the release of version 1.6 of the popular project.

Memcached was originally developed for blogging website LiveJournal in 2003, and is used in web services such as YouTube, Reddit, Twitter, and Wikipedia, which is why the new release deserves at least a quick look.

According to the project’s wiki, one of the major improvements in v1.6 is the new meta protocol, which is meant to bring “huge benefits to performance and correctness of cache systems”. Since it has been in the works for a bit, it is now said to surpass the features of its predecessor, the binary protocol, which is why the latter is now officially deprecated.

Users of the binary protocol however don’t have to fear the change too much. While a switch to meta or text protocols is advised by the team, support and fixes for the old one will still be provided “for years to come”.

To improve performance even further, memcached’s networking code has been refactored “to allow automatic batching of response syscalls”. The change is meant to help to reduce the amount of memory used by idle client connections and prevent memory fragmentation “for systems with a huge number of connections”. Worker threads now get their own “pools of read and write buffers for active client connections” to manage, which can be limited by the new tunables -o resp_obj_mem_limit=N and -o read_buf_mem_limt=N.

The external flash storage system has also received some attention and while it “still requires some careful attention to run in a large production”, it is now deemed to be “generally stable”. Starting from the 1.6 release, the system is compiled by default. However, it has to be explicitly enabled at start time to make sure it doesn’t affect installs of users not intending to use it.