Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Are there any tools to explore what is currently cached inside a memcached pool? Not some much graphs, but the actual key/values currently stored.

share|improve this question
up vote 5 down vote accepted

Try stats items - i.e.

echo "stats items" | nc 11211
share|improve this answer
How does this answer the question?! This only gives out the server statistics, doesn't retrieve any keys. – Jagtesh Chadha Jul 5 '12 at 6:07

The correct answer would be echo "stats cachedump SLABS_ID LIMIT" | nc HOSTNAME PORT

eg. echo "stats cachedump 15 4" | nc 11211

This would give the output on the lines of:

ITEM cache_path-comments%2Fpage%2F2 [2211 b; 1337195558 s]
ITEM cache_path-comments%2Fpage%2F5 [2205 b; 1337195558 s]
ITEM cache_path-comments%2Fpage%2F6 [2179 b; 1337195558 s]
ITEM cache_path-comments [2164 b; 1337195558 s]

Note: This is an undocumented command that is not supported by the memcached team and can be removed in any version. For the complete reference, check out Understanding Memcached stats cachedump command.

share|improve this answer
telnet 0 11211
stats items
set key 1 23 8
get key
share|improve this answer


In the recent version of memcached there is also memcached-tool perl script, e.g. usage:

memcached-tool localhost:11211 dump | less

which dumps all keys and values.


To dump a list of keys from a server, use memdump tool, e.g.

memdump --servers=localhost 

To dump all objects:

memdump --servers=localhost | xargs -L1 -I% sh -c 'echo "get %" | nc localhost 11211'


To dump all keys in Bash shell, try:

exec {memcache}<>/dev/tcp/localhost/11211; printf "stats items\nquit\n" >&${memcache}; cat <&${memcache}


Here is example to get value of single item using netcat:

echo "get 13456_-cache-some_object" | nc 11211
share|improve this answer
This answer helped me find the actual memcached tool : memcdump. See this answer : – mmuller Jun 24 '15 at 8:38

In basic memcached I do not think there is any way of querying for keys stored in the server. The only think you can get is statistics related to storage and stored items.

Some vendors that have developed memcached compliant solutions, e.g. Gear6, have however added functionality to allow querying.

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.