Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view the data in memcache?

Tags:

memcached

I've installed memcache and now how do I really view the data in memcache?

Is there any way to see the data present in cache inside memcache?

How do I really know whether memcache is getting data stored inside it?

Note: I don't want to write any program to see the data inside memcache. Basically, memcache server is already installed in my environment and it is caching the data as well. But I would like to know if there are any utility programs available which will show me the cached data inside memcache or if there is any command which will show me the data cached so far.

like image 578
Mike Avatar asked Dec 07 '11 18:12

Mike


People also ask

How do I view memcache data?

Memcached get command is used to retrieve the value stored at key. This command takes one or more keys and returns all found items. If the key does not exist in Memcached, then it will return nothing.

Where does memcache store data?

How does Memcached work? Unlike databases that store data on disk or SSDs, Memcached keeps its data in memory. By eliminating the need to access disks, in-memory key-value stores such as Memcached avoid seek time delays and can access data in microseconds.

How can I see all keys in Memcached?

In short, to list all keys in Memcached, we obtain the slab ID then list the keys using stats cachedump command.


1 Answers

There is no way to get memcached to report which keys it holds. I believe that this was a design choice as to do so would have a negative impact on performance.

However, you can use any telnet client application to connect the memcached server and type in commands. Doing this to get or set a particular key.

For example,

stats

or:

get MY_KEY
like image 81
Steve Avatar answered Sep 19 '22 17:09

Steve