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.
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.
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.
In short, to list all keys in Memcached, we obtain the slab ID then list the keys using stats cachedump command.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With