Open an interactive session with telnet and run commands line by line
telnet 127.0.0.1 11211Text-protocol read and write commands, stats metrics, memory and connection flags, hit-rate and slab monitoring, with flush_all warnings.
Open an interactive session with telnet and run commands line by line
telnet 127.0.0.1 11211Fetch key statistics in one shot, handy for scripts
printf 'stats\r\nquit\r\n' | nc 127.0.0.1 11211Show connections, hits, memory and evictions
statsShow item counts, age and evictions per slab class
stats itemsShow slab memory allocation and usage to spot fragmentation
stats slabsPrint a table of items, hits and evictions per slab
memcached-tool 127.0.0.1:11211 displayStore a key: flags 0, TTL 900 seconds, 5-byte payload on the following line
set user:42 0 900 5
adminTTLs beyond 30 days must be passed as a Unix timestamp instead of a relative seconds value
Fetch a value; request several keys with one get command
get user:42Store only when the key is absent, useful as a cache stampede placeholder
add user:42 0 900 5Overwrite only when the key already exists
replace user:42 0 900 5Remove a key; DELETED means success
delete user:42Atomic increment of a decimal string value; use decr to decrement
incr counter 1Invalidate every cached item; running this in production causes a cache stampede
flush_allRun in the background with 512 MB memory, 1024 connections and all interfaces
memcached -m 512 -c 1024 -l 0.0.0.0 -p 11211 -dRaise the per-item size limit above the 1 MB default, considering memory impact
memcached -I 4mEnable slab reassignment to relieve uneven utilization across item sizes
memcached -o slab_reassign,slab_automove=2Start with slab_automove at 1; level 2 reclaims more aggressively
Confirm the running memory cap, connection limit and item size limit
stats settingsRead the core counters; hit rate equals get_hits divided by cmd_get
stats | grep -E 'cmd_get|get_hits|get_misses'Show the distribution of item counts by size bucket
stats sizesRequires startup with -o track_sizes; tracking adds overhead
In debug mode, watch the read requests currently being served
watch fetchersReset counters so post-change baselines are clean
stats resetThis website uses cookies to ensure you get the best experience on our website. Privacy Policy.