Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any command line or php script which returns the memcached total memory usage?

share|improve this question
up vote 19 down vote accepted

As Mike said, you can look at the line including the "STAT bytes" to see memory usage:

$ echo "stats" | nc -w 1 <host> <port> | awk '$2 == "bytes" { print $2" "$3 }'
share|improve this answer
Thanks, wish if I could vote up to both of you :) – Maximus Nov 15 '10 at 17:11

memcache's default port is 11211 so if memcache is local

telnet localhost 11211

Then run the stats command and that will spit out memory usage

share|improve this answer
Thanks for the telnet tip, but what should I really read in there? I see STAT bytes 9857275 STAT curr_items 43599 STAT total_items 1048925 and I have the impression that my memcached is never filling up... – Stefano Dec 6 '11 at 22:13
STAT bytes is the line you are looking for total usage – Mike Dec 7 '11 at 2:19

I personally use PhpMemcacheAdmin

It creates an easy to use GUI. Of course you'll need to have PHP support.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.