Anthony Chivetta resume

kmemcached: An in-kernel memcached for Linux

This past semester I took CMU’s 15-412 - Operating System Practicum. As my project I decided to port memcached to the linux kernel.

A little background, Memcached is an in-memory key/value cache service used by nearly all large websites as a lookaside cache to scale their authoritative database. It supports simple operations such as GET, SET, PUT, INCREMENT, etc. on a in-memory hash table of key/value pairs. Servers typically operate as a LRU cache with additional per-item expire times.

Memcached’s use case in web applications means that it is highly latency-sensitive. The dumb logic of the cache means that little time is spent doing business processing. These two factors make memcached a prime candidate to experiment with moving into the kernel as a means of removing sources of latency and experimenting with new techniques for storing data and serving requests for that data.

For example, an in-kernel memcached could make use of the kernel’s LRU mechanism for paging, intelligently page out the LRU values to SSD, and when running into memory pressure make decisions about which items to free based on the current location of the item. In user-space such a scheme would involve many mincore system calls and come with a high performance penalty.

The result of this project is a port of memcached to the Linux kernel as a dynamically loadable module that exists outside of the Linux kernel source tree. The current code is highly experimental but may be used for further development into a production system or experimental endeavors. The code is available as a github project.

blog comments powered by Disqus
Any opinions expressed here are mine only. This site powered by Jekyll.
This site licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.