What are some helpful tips / tools for monitoring / tuning memcached health?

Yesterday I found this cool script ' memcache-top ' that nicely displays life statistics in memcached. Looks like,

memcache-top v0.6 (default port: 11211, color: on, refresh: 3 seconds) INSTANCE USAGE HIT % CONN TIME EVICT/s READ/s WRITE/s 127.0.0.1:11211 88.8% 94.8% 20 0.8ms 9.0 311.3K 162.8K AVERAGE: 88.8% 94.8% 20 0.8ms 9.0 311.3K 162.8K TOTAL: 1.8GB/ 2.0GB 20 0.8ms 9.0 311.3K 162.8K (ctrl-c to quit.) 

it even makes certain text red when you have to pay attention to something!

Q. In general, what are some useful tools / methods that you used to verify that memcached is configured well?

+11
memcached
Apr 19 '13 at 17:19
source share
2 answers

A good interface for accessing Memcached server instances is phpMemCacheAdmin .

I prefer command line access using telnet .

To connect to Memcached using Telnet, use the following telnet localhost 11211 command from the command line.

If you want to end your Telnet session at any time, just type quit and press return.

You can get an overview of the important statistics of your Memcached server by running the stats command after connecting.

The memory is distributed inside pieces inside and is constantly reused. Since the memory is divided into plates of different sizes, you lose memory if your elements do not fit perfectly into the panel that the server decides to put.

Thus, Memcached automatically allocates your data to different "plates" (think of it as partitions) of memory, based on the size of your data, which, in turn, makes the memory allocation more optimal.

To list the slabs in the instance you are connected to, use the stats slab command.

A more useful command is stats items , which will provide you with a list of slabs, which includes the number of items stored in each panel.

Now that you know how to list plates, you can browse inside each panel to list the elements contained inside using the stats cachedump [slab ID] [number of items, 0 for all items] command.

If you want to get the actual value of this element, you can use the get [key] command.

To remove an item from the cache, you can use the delete [key] command.

+18
Apr 23 '13 at 0:33
source share

For production systems, you really need to set up active monitoring (with downtime warnings, automatic reboots, etc.) of Memcache using something like Monit . Here is a config example: Monitoring Memcache with Monit

+3
Jul 09 '13 at 14:35
source share



All Articles