简体   繁体   English

memcached何时删除项目?

[英]When does memcached remove items?

I'm relatively new to memcached and only know the basics of getting it set up and working. 我对memcached相对较新,并且只了解设置和工作的基本知识。 I've run into an issue on our Magento-based website where the cache is growing too large and causing some slowness when editing product details. 我在我们基于Magento的网站上遇到了一个问题,该网站的缓存太大了,在编辑产品详细信息时会导致速度变慢。 I telnetted to the memcached server and ran stats and noticed that there were nearly 900 megs and over 65500 items in there. 我通过telnet到memcached服务器并运行了统计信息 ,发现那里有将近900兆和65500多个项目。 I typed the flush_all command and re-ran stats and it's still the same. 我输入了flush_all命令并重新运行统计信息,它仍然相同。 After some research I have found that flushing it invalidates the entries but doesn't actually free up the space. 经过一番研究,我发现刷新它会使条目无效,但实际上并没有释放空间。 It will do so over time as new items are added. 随着时间的推移,它将添加新项目。 From what I have seen, it never frees up the nearly 900 megs of space and never deletes the 65000+ items that seem to be stuck in there. 从我所看到的,它永远不会释放将近900兆的空间,也永远不会删除似乎卡在其中的65000多个项目。 I haven't tried restarting memcached yet as this is a live site and I don't want to cause any problems. 我尚未尝试重新启动memcached,因为这是一个实时站点,并且我不希望引起任何问题。 If restarting the server frees up the space, that's still not a solution because I don't want to have to do that every time. 如果重新启动服务器可以释放空间,那仍然不是解决方案,因为我不想每次都这样做。 Can someone please help me understand what's going on and how I can fix this? 有人可以帮我了解发生了什么以及如何解决此问题?

You'll want to tweak the maximum amount of memory Memcached is allowed to use in an instance. 您需要调整Memcached在实例中允许使用的最大内存量。 At the command line, the -m flag is used to set the maximum number of megabytes the cache can hold. 在命令行上, -m标志用于设置高速缓存可以容纳的最大兆字节数。 Flushing the cache merely invalidates everything in it, and the items are evicted lazily. 刷新缓存只会使其中的所有内容失效,并且项目会被懒惰地逐出。 If you want memcached to use less memory, there's no getting around it: you'll have to restart it with less memory. 如果您想让Memcached使用更少的内存,那就没有办法了:您必须以更少的内存重新启动它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使未达到limit_maxbytes,Memcached也开始逐出项目 - Memcached started evicting items even when limit_maxbytes was not reached 安装memcached时找不到libevent的符号链接 - symbolic link for libevent not being found when installing memcached 如何确定memcached中的数据应何时过期? - How do I determine when data in memcached is supposed to expire? “尝试在Ubuntu中安装Memcache时发生致命错误:类'Memcached'未找到” - “Fatal error: Class 'Memcached' not found” when trying to install Memcache in Ubuntu 当名称不包含某些单词时删除文件 - remove files when name does NOT contain some words 安装memcached时,我收到“配置:错误:在$ PATH中找不到可接受的C编译器” - When installing memcached I receive 'configure: error: no acceptable C compiler found in $PATH' 在Linux中删除列表变量中的重复项 - remove repeated items in a list variable in linux 从C中的队列中删除项目的线程 - Threads to remove items from a Queue in C 为什么在安装memcached之后需要一个用户memcached和一个组memcached? - why we need a user memcached and a group memcached after installing memcached? 当我在命令提示符下输入“ dpkg -l”时,“所需=未知/安装/删除/清除/保留”是什么意思? - What does “Desired=Unknown/Install/Remove/Purge/Hold” mean when I enter “dpkg -l” in the command prompt?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM