Memcache Monitoring Tools--Memkeys
Introduced
Memkeys is a top-of-the-line, Tumblr-like tool that can be used to view memcached's key usage in real time.
Installation
Install autoconf (requires version 2.68 or more):
# wget-c http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz# tar zxvf autoconf-latest.tar.gz# cd autoconf-2.69#./ configure# make && make install
Install other dependencies:
# yum Install libpcap-devel pcre-devel ncurses-devel
Install Memkeys:
# git clone https://github.com/tumblr/memkeys.git# cd memkeys#/autogen.sh#./configure# make && make install
Use
# memkeys-h
usage: memkeys -i nic [options]-d, --discard= thresh discard keys where req/s rate is below thresh-i, -- interface=nic network interface to capture traffic on (required)-p, -- port=port network port to capture memcache traffic on (default 11211)-r, --refresh=interval refresh the stats display every interval ms (default 500)-l, --logfile=file output logs to file-r, --report= report output data in report format (csv or curses, default Curses)-h, --help this help-v, --verbose increase verbosity. may be used multiple times.-v, --version show program info and exit.
Capture the usage of memcached key on eth0, logging to/tmp/memkeys.log:
Memkeys-i eth0-l/tmp/memkeys.log
The results appear similar to the following:
Memcache Key calls ObjSize req/sec BW (kbps) Username 1 0.14 0.01key12 1 6 0.07 0.00key10 1 6 0.06 0.00sort mode:reqrate (DESC) keys:3 Packets (recv/dropped): 24/0 (0.00%) rt:1 (ms) B:sort by bandwidth | C:sort by calls | Q:quit | R:sort by Req/sec | S:sort by Size | T:toggle sort order (ASC|DESC)
When you run Memkeys on a machine with a large amount of network traffic, you need to define a threshold for requests per second, filter out req/sec less than the specified value, or the memory footprint will grow quite large.
Memkeys-i eth0-d 10.0-l/tmp/memkeys.log
This article is from the SQL Server deep dives blog, so be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1637555
Memcache monitoring Tool--Memkeys