Memcache won't flush or clear memory

前端 未结 5 1358
天命终不由人
天命终不由人 2021-02-19 10:19

I\'ve been trying to clear my memcache as I\'m noticing the storage taking up almost 30% of server memory when using ps -aux.

So I ran the following php co

5条回答
  •  忘了有多久
    2021-02-19 10:33

    Colin, The Flush All command causes the cache to set all the expiration times to current. The next request for an existing key will return nothing and the record will be removed from the cache. Memcached does not have a separate process to clean expired items and uses a "Lazy" method which makes the process very lightweight and efficient. Because of this if you need to actually remove the cache and start from scratch, the only real way to accomplish this is to restart Memcached. A long workaround would be to dump all your keys, send the Flush All command, then loop through each key running a get against it, causing the record to be removed. Not 100% sure if this method would work but in theory sounds plausible.

提交回复
热议问题