Newbie question

Peter van Dijk peter at nextgear.nl
Fri Dec 9 09:30:28 UTC 2005


On Wed, Dec 07, 2005 at 10:49:08PM -0800, Jeff Rodenburg wrote:
> I'm new to memcached and need a little guidance.  I've got a relative
> understanding of how memcached works and would like to monitor the service.
> Is it possible to measure the available capacity of a running memcached
> instance?  For example, considering a memcached daemon allocated 2GB of RAM,
> how much available space exists on that instance?
> 
> My goal is to understand how much cache is being used in order to plan how
> many more daemons/systems we need to allocate.  I'm not even sure if this is
> an appropriate approach, but I wasn't able to find an answer in the mailing
> list archives.

# telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost
Escape character is '^]'.
stats
STAT pid 7160
STAT uptime 12259115
STAT time 1134120329
STAT version 1.1.11
STAT rusage_user 152:349128
STAT rusage_system 284:196501
STAT curr_items 26837
STAT total_items 342093
STAT bytes 1594665
STAT curr_connections 1
STAT total_connections 814007
STAT connection_structures 7
STAT cmd_get 846178
STAT cmd_set 342078
STAT get_hits 764174
STAT get_misses 82004
STAT bytes_read 94808973
STAT bytes_written 182472401
STAT limit_maxbytes 134217728
END

Specifically, `bytes' is the amount of memory in use within memcache,
out of a maximum of limit_maxbytes (which would be ~2GB in your case).
However, keep in mind that `bytes' may count data that is ready to 
be expired but hasn't been removed yet.

Most client libraries have functionality to extract these statistics.

Regards,
Peter.


More information about the memcached mailing list