tcprstat工具安装与使用

author:skate
time:2013/01/11


tcprstat工具安装与使用

tcprstat是免费开源tcp分析工具,通过监控网络传输来统计分析请求的响应时间


使用方法:
tcprstat是安装在server端,统计分析本地网卡地址请求的响应时间,可以用于临时分析,也可定时任务做信息收集


下载
# wget http://github.com/downloads/Lowercases/tcprstat/tcprstat-static.v0.3.1.x86_64
# cp tcprstat-static.v0.3.1.x86_64 tcprstat
# chmod a+x tcprstat

 

tcprstat在bonding的网卡下有点问题

[root@localhost oradisk]# ifconfig
bond0     Link encap:Ethernet  HWaddr 90:B1:1C:20:C4:32 
          inet addr:172.16.100.87  Bcast:172.16.100.255  Mask:255.255.255.0
          inet6 addr: fe80::92b1:1cff:fe20:c432/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:1045751465 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1049414338 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:143835655125 (133.9 GiB)  TX bytes:405336708220 (377.4 GiB)

em1       Link encap:Ethernet  HWaddr 90:B1:1C:20:C4:32 
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:395396 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:28185234 (26.8 MiB)  TX bytes:4634 (4.5 KiB)
          Interrupt:35
......

 

# ./tcprstat -p 1588 -t 1 -n 0
pcap: SIOCGIFFLAGS: bonding_masters: No such device

 

指定确定ip地址可以避免上面的错误

[root@localhost oradisk]# ./tcprstat -p 1588 -t 1 -n 0 -l 172.16.100.87
timestamp       count   max     min     avg     med     stddev  95_max  95_avg  95_std  99_max  99_avg  99_std
1357885445      256     73120   67      746     245     4607    995     349     285     3107    399     405
1357885446      256     2610    84      365     255     317     846     330     266     906     351     281
1357885446    36      968     127     370     278     287     900     336     259     908     353     272

 

还可以通过如下的方式,不过是统计分析机器的所有ip地址
# ./tcprstat -p 1588 -t 1 -n 0 -l `/sbin/ifconfig | grep 'addr:[^ ]\+' -o | cut -f 2 -d : | xargs echo | sed -e 's/ /,/g'`

 

如下是一台生产数据库的响应时间
[root@skate01 oradisk]# ./tcprstat -p 1588 -t 1 -n 0 -l `/sbin/ifconfig | grep 'addr:[^ ]\+' -o | cut -f 2 -d : | xargs echo | sed -e 's/ /,/g'`
timestamp       count   max     min     avg     med     stddev  95_max  95_avg  95_std  99_max  99_avg  99_std
1357886048      5840    26133   54      240     163     500     664     184     101     1411    214     183
1357886049      6003    3405    57      227     164     242     660     182     96      1296    211     173
1357886050      6376    27322   29      269     168     689     724     194     117     1643    226     196
1357886051      6524    20489   58      225     167     330     613     182     92      1168    208     160
1357886052      6123    33313   52      231     165     497     627     181     94      1213    209     164
1357886053      6991    66977   55      221     167     822     525     176     80      1120    199     140
1357886054      5876    11483   57      234     162     427     610     177     89      1195    204     160
1357886055      6166    189134  30      526     187     3085    1265    245     202     6366    342     561
1357886056      5678    5913    52      210     161     218     553     172     81      1100    196     142

 

 

参考:http://www.percona.com/docs/wiki/tcprstat:start

 

---end---

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值