Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Memcached eviction when cache is 40% full

Tags:

memcached

I am seeing evictions when the memcached is only 40% full. How is that possible?

like image 812
apatel Avatar asked Jun 18 '12 19:06

apatel


People also ask

What happens when memcache is full?

First, when memcached gets full, it will start removing items from the cache using the Least Recently Used algorithm. Second, you can have multiple instances of memcached running, adding them gets complicated because it will change the hashing algorithm used to determine which cache the data is in.

What is Memcached eviction?

Memcached servers in a Memcached memory pool are unaware of each other. The servers track which data in their local array was least-recently used, and will purge that data as needed to make room for newer requests (called an eviction).

Does memcached use LRU?

Standard Memcached, at its core, uses a typical hash table design, with linked-list-based chaining to handle collisions. Its cache replacement algorithm is strict LRU, also based on linked lists.


1 Answers

Check the slab sizes by running the memcached stats. Looks like your slabs are not evenly populated and that is causing the evictions even when the cache is not full full.

like image 69
Justin Avatar answered Oct 05 '22 23:10

Justin