After memcache limits memory usage, will the old unexpired items be deleted when new items are added? What should I do?
Source: Internet
Author: User
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, for example, 100 m, the added items are not used up after the memcache's limited memory is used up first, will the old non-expired 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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.