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