Federico Cargnelutti

Simple is better than complex. Complex is better than complicated. | @fedecarg

Command-line memcached stat reporter

with 4 comments

Nicholas Tang wrote a nice little perl script that shows a basic memcached top display for a list of servers. You can specify thresholds, for instance, and it’ll change color to red if you exceed the thresholds. You can also choose the refresh/sleep time, and whether to show immediate (per second) stats, or lifetime stats.

To install it you only need to download the script and make it executable:

$ curl http://memcache-top.googlecode.com/files/memcache-top-v0.6 > ~/bin/memcache-top
$ chmod +x ~/bin/memcache-top
$ memcache-top --sleep 3 --instances 10.50.11.3,10.50.11.4,10.50.11.5

Here’s some sample output:

memcache-top v0.6       (default port: 11211, color: on, refresh: 3 seconds)

INSTANCE                USAGE   HIT %   CONN    TIME    EVICT/s GETS/s  READ/s  WRITE/s
10.50.11.3:11211        88.9%   69.7%   1661    0.9ms   0.3     47      13.9K   9.8K
10.50.11.4:11211        88.8%   69.9%   2121    0.7ms   1.3     168     17.6K   68.9K
10.50.11.5:11211        88.9%   69.4%   1527    0.7ms   1.7     48      14.4K   13.6K
AVERAGE:                84.7%   72.9%   1704    1.0ms   1.3     69      13.5K   30.3K   

TOTAL:          19.9GB/ 23.4GB          20.0K   11.7ms  15.3    826     162.6K  363.6K
(ctrl-c to quit.)

Project Home
http://code.google.com/p/memcache-top/

About these ads

Written by Federico

November 29, 2009 at 3:28 pm

Posted in Open-source, Tools

4 Responses

Subscribe to comments with RSS.

  1. Did you copy/paste the output without editing? If so, something’s wrong… the averages don’t seem to be computed correctly. Whoops. :)

    Nicholas Tang

    September 15, 2010 at 2:40 am

  2. I removed a couple of servers from the list :) Very handy script BTW, thanks!

    Federico

    September 15, 2010 at 6:48 am

  3. geek porn ;-)

    Iouri Goussev

    January 5, 2011 at 7:03 am

  4. If you get an HiRes error when running you might want to install:

    sudo yum install perl-Time-HiRes


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,033 other followers