Skip to content

Instantly share code, notes, and snippets.

@wrobstory
Created August 31, 2015 20:44
Show Gist options
  • Save wrobstory/cfa109e2f2fad6fe04f9 to your computer and use it in GitHub Desktop.
Save wrobstory/cfa109e2f2fad6fe04f9 to your computer and use it in GitHub Desktop.
IMDM 2015 Cost-based Memory Partitioning and Management in Memcached

Cost-based Memory Partitioning and Management in Memcached, Damiano Carra (University of Verona), Pietro Michiardi (Eurecom)

  • Memcached: Key-value store, common component of web architectures (caching layer), all data kept in-memory (RAM)
  • Memchached divides objects in classes depending on size (small, medium, large)
  • Memory divided into blocks called "slabs", default slab is 1 MB. Slab contains variable number of objects.
  • Slabs are assigned to classes upon request
  • After many requests, available memory (divided into slabs) is full, what happens with new request?
  • Memcaches uses LRU eviction within the class
  • Challenges: how is memory divided among the classes? Static vs. dynamic assignment
  • Given a trace and an eviction policty, can compute miss-ratio curves (MRC)
  • Goal -> minimize the miss ratio
  • Can compute optimal slab assignment based on shape of MRC
  • Need new interface: the interface set(k,v) implies that all objects have same cost or weight
  • But some objects can be difficult to obtain, because they are larger, or it takes more time to retrieve them, etc
  • New interface! set(k,v,c), where the application can assign a cost to the object!
  • Slab Allocation Schema: Define observation epoch, e.g. when system has experienced M misses
  • During each epoch, collect (for each class): number of weighted misses, number of weighted requests
  • High number misses -> class is suffering
  • Low number misses -> class can lose a slab
  • Trace driven experiment with traces collected by major CDN operator
  • Interesting finding: cost is not correlated with object size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment