介绍
mctop 与 memcache-top 相似,主要用于监视 Memcache 的流量,包括 key 的调用次数、对象存储大小、每秒的请求数、以及消耗的网络带宽等。
源代码:https://github.com/etsy/mctop
安装
1
2
3
4
5
6
7
8
9
10
11
12
13
|
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
|
使用
查看帮助:
1
|
mctop –h
|
1
2
3
4
5
6
7
|
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
|
1
|
mctop -i eth0 -p 11211
|
输出类似如下信息:
1
2
3
4
5
6
7
|
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)
|
本文转自UltraSQL51CTO博客,原文链接:http://blog.51cto.com/ultrasql/1637615
,如需转载请自行联系原作者