If you are using memcahced for caching it will be is sometimes necessary to check the state of the cache. There is no way to dump all keys stored in a memcached server but using cache dump we can retrieve about a megabyte of data which is often sufficient for debugging.
To retrieve the keys first telnet to your server:
Use the stats command to get stats about the different slabs of keys in your server. The number after "items:" is a slab id and memecached will store your stats in several slabs.
To get the keys stored in each slab use the cachedump command. In the command shown below we are retrieving a maximum of hundred keys from the 4th slab.