> I had a look at: > https://code.google.com/p/memcached/wiki/NewUserInternals#How_the_LRU_Decides_What_to_Evict > which sais memcache will "evict" one that isn't expired if it cannot > find an expired item. Am I correct to assume that it's evicting by LRU > logic? Is this an ordered stack eviction, or are there any random bits > in there?
Heh. Not sure where the fuzzyness is coming from here. As it says in the URL, in the title of the section, and twice in the text: 'If there are no free chunks, and no free pages in the appropriate slab class, memcached will look at the end of the LRU for an item to "reclaim". It will search the last few items in the tail for one which has already been expired, and is thus free for reuse.' So no, not random, but it tries to walk up the tail a little to find something expired if the very bottom isn't expire. -Dormando
