Cache Server: Memcached Contents Survive Reboot –

The developers of the cache server Memcached have released version 1.5.18 of their software, With Memcached, certain content can be kept permanently in memory to accelerate access to it. With the now available version, this content can also be obtained through reboots of the application.

Job market

  1. BWI GmbH, Bonn / several locations
  2. Heinrich-Heine-University Dusseldorf

Is used for it the function DAX (Direct Access), which has been introduced with Linux 4.0. When using persistent storage, it ensures that data is read directly and not sent via the page cache. Now DAX is used on Memcached, so that the cache also survives reboots of the system.

However, according to the release notes, this does not happen automatically, instead admins need to configure it by using the line "-e / tmpfs_mount / memory_file" is added as a startup option. at Tmpfs_mount it must be a ramdisk that should be larger than the one above the parameter -m set memory limit for memcached.

Memcached moves only item data into an external Mmap file for the new feature. Hash tables and connection data remain in normal memory. After the restart the daemon reads the file again, restores internal pointers and regenerates the hash tables. This takes a few seconds to a few minutes, depending on the size of the cache.

False start possible

To restart the cache server, the signal may be SIGUSR1 sent to the daemon, whereupon memcached a file called /tmpfs_mount/memory_file.meta invests. After restarting, Memcached reads this file again and continues with his work. If the generated file is not compatible or corrupted, the process fails and Memcached starts with an empty cache.

The new feature is still experimental, the developers write and therefore hope for feedback from users. And to be able to use the technology at all, some conditions must be considered. Thus, the system clock must be set correctly and must not jump while memcached is shut down. Also, certain commands are not available at reboot.