question about the LRU

Tomash Brechko tomash.brechko at gmail.com
Fri Jan 4 08:55:47 UTC 2008


On Thu, Jan 03, 2008 at 11:34:23 +0100, Mathieu Viel wrote:
> I thought that since i frequently get the value of this item, it would 
> not make it the LRU one so its would never be somehow erased.

item.c has the following:

 /*
  * We only reposition items in the LRU queue if they haven't been repositioned
  * in this many seconds. That saves us from churning on frequently-accessed
  * items.
  */
 #define ITEM_UPDATE_INTERVAL 60


I guess you fill up 1MB rather quickly, so the item in question is
never repositioned in LRU queue, and eventually popped off despite the
fact of being accessed frequently.

Increasing the cache size will help, as popular item will be
repositioned sooner than it reaches the head of the queue.


-- 
   Tomash Brechko


More information about the memcached mailing list