Memcache监控工具 -- mctop
介绍
mctop 与 memcache-top 相似,主要用于监视 Memcache 的流量,包括 key 的调用次数、对象存储大小、每秒的请求数、以及消耗的网络带宽等。
源代码:https://github.com/etsy/mctop
安装
cd /usr/local yum install libpcap-devel ruby-devel rubygems git gem sources --remove https://rubygems.org/ gem sources -a https://ruby.taobao.org/ gem sources -l gem install ruby-pcap -v ‘0.7.8‘ gem install bundle gem install rake git clone https://github.com/etsy/mctop.git cd mctop bundle install rake install ln -s /usr/local/mctop/bin/mctop /usr/bin/mctop
使用
查看帮助:
mctop –h
Usage: mctop [options] -i, --interface=NIC Network interface to sniff (required) --host=HOST Network host to sniff on (default all) -p, --port=PORT Network port to sniff on (default 11211) -d, --discard=THRESH Discard keys with request/sec rate below THRESH -r, --refresh=MS Refresh the stats display every MS milliseconds -h, --help Show usage info
mctop -i eth0 -p 11211
输出类似如下信息:
memcache key calls objsize req/sec bw(kbps) key12 1 6 0.02 0.00 key10 1 6 0.02 0.00 username 1 12 0.02 0.00 sort mode: reqsec (desc) keys: 3 packets (recv/dropped): 21 / 0 ( 0.00%) rt: 0.719 (ms) Q:quit | C:sort by calls | S:sort by size | R:sort by req/sec | B:sort by bandwidth | T:toggle sort order (asc|desc)
时间: 2024-10-11 16:06:18