Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to flush the memcached cache keys and values on my centos server.

I have tried the telnet approach by telnetting to the port and then issuing: flush_all

It doesn't work an my values are still cached.

Does anyone know how I can accomplish this?

share|improve this question
What is the "this" you are trying to accomplish exactly? What is the problem you are trying to solve? The flush_all command doesn't remove anything from the cache. It just marks the entries invalid. – David Schwartz Sep 18 '12 at 1:01
You could just restart the daemon – Ben Lessani - Sonassi Sep 18 '12 at 8:06

Mark all items as stale (it will not clean the cache itself)

echo flush_all | telnet 11211

Perform dump, it will clean the stale items (but it may not deallocate memory)

/usr/share/memcached/scripts/memcached-tool dump > /dev/null

You can check the cache usage by

/usr/share/memcached/scripts/memcached-tool display

Tested on memcache 1.4.13

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.