问题描述:

I am using python/Django in my project with memcache. i just want to know what will happen if any of cache key get expired ? will the memory be free and ready to reuse?

网友答案:

Checkout Memcached's wiki article NewUserInternals - No Guts No Glory. An item that expires will continue to set in memory until one of the following happens:

  • Client will attempt to fetch expired data. Memcached will see that it's expired, reclaim the memory, and not return the value to the client.
  • When a client request to store a new item, Memcached will check against Least Recently Used (LRU) for any expired items, and reclaim the memory.
相关阅读:
Top