tags:

views:

287

answers:

3

I'd like to visualise the RAM usage of a Memcached daemon - what is the best utility to use?

Ideally I'd like to user Perl.

A: 

if you want to build your own little tool you should check out RRDtool

tliff
+1  A: 

Take a look at Amnesia (http://github.com/benschwarz/amnesia/tree/master), it probably has something to do what you want.

womble
+2  A: 

Memcache reports a number of statistics such as memory used, objects stored, hits and misses. Connect to the server (probably localhost:11211) with a standard TCP socket and write "stats\n" to get back a list of statistics. See below for an example.

Look at Cacti for actually graphing the data. I've had great success with it.

> $ telnet localhost 11211
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stats
STAT pid 75723
STAT uptime 4166691
STAT time 1236609062
STAT version 1.2.4
STAT pointer_size 32
STAT rusage_user 115.028511
STAT rusage_system 326.163351
STAT curr_items 83335
STAT total_items 1822140
STAT bytes 239997834
STAT curr_connections 48
STAT total_connections 7840
STAT connection_structures 83
STAT cmd_get 4273541
STAT cmd_set 1822140
STAT get_hits 2442609
STAT get_misses 1830932
STAT evictions 1696494
STAT bytes_read 5162992092
STAT bytes_written 7000049654
STAT limit_maxbytes 268435456
STAT threads 1
END
Andrew Wilkinson