Monday, January 11, 2010

Monitor Memcached status

It is quite a important task to manage and monitor the memcache caching system. There are quite a lot of options to carry out this operation.

1. Using Telnet Command Line interface

List of supported commands are available at

telnet localhost 11211

List of keys used

stats items

STAT items:5:number 2
STAT items:5:age 47
STAT items:5:evicted 0
STAT items:5:evicted_nonzero 0
STAT items:5:evicted_time 0
STAT items:5:outofmemory 0
STAT items:5:tailrepairs 0

2. Using memcached-tool

The memcached tool is available in the source directory .



/usr/src/memcached-1.4.4/scripts/memcached-tool stats

Show slab information

/usr/src/memcached-1.4.4/scripts/memcached-tool display

Show keys and values

/usr/src/memcached-1.4.4/scripts/memcached-tool dump

3. Using the damemtop

A flexible 'top' like utility for viewing memcached clusters. You can use it to manage a interactive cluster status.

The utility is available in the source directory. /usr/src/memcached-1.4.4/scripts/damemtop

It require you to install the following perl modules

cpan AnyEvent Term::ReadKey YAML

Now you need the /etc/damemtop.yaml file with the following contents.

delay: 3
mode: t
sort_column: "hostname"
sort_order: "asc"
- hostname
- all_version
- all_fill_rate
- hit_rate
- evictions
- bytes_written
- "2:get_hits"
- 127.0.01:11211

In a distributed environment you can add all the servers in the cluster to the file and issue the following command.


That would give you a ideal monitoring setup..

1 comment: