Where the open source database community meets: Use code PERCONA75 and secure your spot for Percona Live.  Register

Memcached Status

November 27, 2008
Author
Baron Schwartz
Share this Post:

There are all sorts of different interfaces to memcached, but you don’t need any of them to make requests from the command line, because its protocol is so simple. Try this, assuming it’s running on the usual port on the local machine:

Here’s an easy “top” emulator for memcached:

If you don’t have netcat (nc), you can also use Bash’s built-in /proc/tcp magic if it’s enabled. Anything that can push a couple of characters to a TCP port and print the result to stdout will work. Or you can use something like this if you must do it via PHP:

More resources…

Blog Posts

0 0 votes
Article Rating
Subscribe
Notify of
guest

5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Dieter_be
17 years ago

You can do even more fun/specific stuff like ‘stats items’, ‘stats sizes’, ‘stats slabs’, …
See http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt

Another client worth mentioning is telnet. The advantage over netcat is the interactivity. (but then again nc is good for scripting)

gorenje
gorenje
15 years ago

watch “(echo stats ; echo quit ) | nc 127.0.0.1 11211” works, echo stats doesn’t since memcache expects you to quit the connection.

Steve Batcup
Steve Batcup
13 years ago

This helped me a great deal, thank you.

Emptywalls
12 years ago

Thanks! Exactly what I needed.

Mischa ter Smitten
11 years ago

‘@gorenje You can also use the -q option:

watch “echo stats | /bin/netcat -q 2 127.0.0.1 11211”;

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved