做网络测试一般都是用netperf,不过刚有人推荐了个新工具,就拿来测了下,很简单使用。简记一下使用方法如后。
安装
yum install -y qperf
依赖包: libibverbs-1.1.5-3.el6.x86_64 librdmacm-1.0.14.1-3.el6.x86_64
使用
service端,执行不带参数的qperf
默认会启用 19765端口。
client端,
1
2
3
4
5
6
|
# qperf 10.177.32.13 tcp_bw tcp_lat
tcp_bw:
bw = 118 MB
/sec
tcp_lat:
latency = 34.8 us
|
就可以显示client端到service的tcp带宽及延迟时间。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# qperf 10.177.32.13 tcp_bw tcp_lat conf
tcp_bw:
bw = 118 MB
/sec
tcp_lat:
latency = 35.1 us
conf:
loc_node = test1
loc_cpu = 8 Cores: Intel Xeon E5504 @ 2.00GHz
loc_os = Linux 2.6.32-220.el6.x86_64
loc_qperf = 0.4.6
rem_node = test2
rem_cpu = 16 Cores: Intel Xeon E5620 @ 2.40GHz
rem_os = Linux 2.6.32-220.el6.x86_64
rem_qperf = 0.4.6
|
增加个conf项就可以显示service及client端的hostname,cpu及系统版本信息。
其他
除了tcp外,还可以测试rdma, udp, sctp等网络协议的带宽和延迟。具体方法参见man qperf。