Memcached Key Dump with stats cachedump
stats cachedump is the old-school slab-based key dump. It’s still useful in labs and older deployments, but it’s noisy, limited, and increasingly disabled.
Notice
stats cachedump is treated as a last-resort debugging command in the memcached ecosystem. Prefer lru_crawler metadump when available.
Get active slab IDs
This prints slab IDs you can target.
Dump keys from a slab
Pick a slab ID from the previous output.
ITEM session:9f3c... [248 b; 1700000000 s] ITEM csrf:... [64 b; 1700000000 s] END
Interpretation:
The bracket shows value size and expiry timestamp. Prioritize keys with longer expiry or
0style expiry where applicable.
Pull values for dumped keys
Extract keys from cachedump output and fetch values:
Common failure modes
Cachedump is disabled
You may see errors instead of ITEM lines.
Warning
Newer or hardened deployments can disable dumping (-X disables stats cachedump and lru_crawler metadump). If you hit this, stop hammering and switch to metadump, known-key reads, or application-driven guessing.
Cachedump does not return everything
Even when it works, it is not a complete dump. Memcached does not guarantee it can enumerate all keys reliably via this mechanism.
References
-
docs.memcached.orgdocs.memcached.org/protocols/basic (opens in new tab)
Memcached Basic Text Protocol, stats/items/cachedump command behavior.
-
groups.google.comgroups.google.com/g/memcached/c/1-T8I-RVGKM (opens in new tab)
Memcached mailing list discussion on removing stats cachedump and why it’s problematic.
-
manpages.debian.orgmanpages.debian.org/unstable/memcached/memcached.1.en.html (opens in new tab)
memcached -X disables cachedump and metadump.
Was this helpful?
Your feedback helps improve this page.