After memcache limits memory usage, will the old unexpired items be deleted when new items are added? After memcache limits memory usage, will the old unexpired items be deleted when new items are added? Or how? For example, all of them are not expired, that is, they are all effective cache Time. after the maximum memory usage is exceeded, such as 100 m, is the added item first-in-first-out? ------ Solution -------------------- after lru automatically clears the memory limit of memcache, will the old unexpired items be deleted when new items are added?
After memcache limits memory usage, will the old unexpired items be deleted when new items are added? Or how?
For example, all of them are not expired, that is, they are all effective cache Time. after the maximum memory usage is exceeded, such as 100 m, is the added item first-in-first-out?
------ Solution --------------------
Lru automatically clears less recently used ones and overwrites the new ones.
------ Solution --------------------
Memcache memory is allocated by page and is divided into more small pieces after one page is allocated. in this case, the memory is recycled by page, therefore, it is often possible to recycle things that are not necessarily "old", so there will be a hit rate problem. if your server has a small available memory, do not use memcache, you can consider using a file-type hash cache class.
------ Solution --------------------
Http://hi.baidu.com/joysoftfan/blog/item/e6deaae459d7ae3ab9382035.html
Google, and then I wrote a script to test it, as 2L said.