Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can memcache tell you how much memory it is using?

Can memcache tell you how much memory it is using in total?

How about for a particular key?

like image 473
Blankman Avatar asked Feb 22 '11 17:02

Blankman


2 Answers

And on the command line, you could do this:

echo "stats" | nc 127.0.0.1 11211 | grep bytes
like image 169
Paul D. Waite Avatar answered Oct 18 '22 12:10

Paul D. Waite


In php, but I'm sure you are able to translate to RoR:-

echo "You are using " . $memcache->getstats()["bytes"] . " of storage ";
echo "out of " . $memcache->getstats()["limit_maxbytes"];

See http://php.net/manual/en/memcache.getstats.php

like image 40
servermanfail Avatar answered Oct 18 '22 14:10

servermanfail