My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 24, 2009 by brianlmoon
HowToMonitor  
Monitoring memcached

Or, just do a simple connect to the port where memcached is listening. You can run a simple command like 'version' or 'stats' to see if memcached is listening.


Comment by todd.fisher, Oct 21, 2008

I use this monit script

check process memcached with pidfile /var/run/memcached/memcached.pid
  group memcached
    start program = "/etc/init.d/memcached start"
    stop program = "/etc/init.d/memcached stop"
    if failed host 127.0.0.1 port 11211 then restart
Comment by harmaarts, Jan 19, 2009

I use the following very easy munin script, play around with the stats method to get what you want:

#!ruby
require 'rubygems'
require 'memcache'

if ENV['HOST'].nil? or ENV['PORT'].nil?
  puts "Define a HOST and PORT!"
  Kernel.exit(1)
end

server_str = ENV['HOST'] + ":" + ENV['PORT']

if ARGV.first == "config"
  puts "graph_title #{server_str} - items"
  puts 'graph_category Memcached'
  puts 'graph_vlabel Items'
  puts 'curr_items.label Current items'
  puts 'evictions.label Items ousted'
else
  mem = MemCache.new(server_str)
  stats_hash = mem.stats[server_str]
  puts "curr_items.value #{stats_hash['curr_items']}"
  puts "evictions.value #{stats_hash['evictions']}"
end
Comment by nicholastang, Apr 23, 2009

I wrote a simple perl script that has output similar to the unix "top" command.

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

Comment by virtix, Sep 20, 2009

fyi, http://github.com/andrewfromgeni/mcinsight, no longer exists @github


Sign in to add a comment
Hosted by Google Code