Memcache maximum key expiration time

前端 未结 7 1134
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 03:45

What\'s memcached\'s maximum key expiration time?

If I don\'t provide an expiration time and the cache gets full, what happens?

7条回答
  •  囚心锁ツ
    2020-12-05 04:44

    If you don't provide expiration and cache gets full then the oldest key-values are expired first:

    Memory is also reclaimed when it's time to store a new item. 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. If it cannot find an expired item however, it will "evict" one which has not yet expired. This is then noted in several statistical counters

    https://github.com/memcached/memcached/wiki/UserInternals#when-are-items-evicted

提交回复
热议问题