linux点对点带宽测试,iperf点对点网络性能测试工具

如果在测试中想知道两台机器见最大的连接速度。用scp拷一个文件应该是最容易的方法。但是不准确。 iperf 这个小工具就是专门用来干这个的。结果相对来说准确一些。使用起来也很方便。

首先在两台机器上都安装iperf

$ sudo apt-get install iperf

然后在需要测试的一台机器上 启动 iperf 监听

$ iperf -s

------------------------------------------------------------

Server listening on TCP port 5001

TCP window size: 85.3 KByte (default)

------------------------------------------------------------

然后在另外一台机器上连接过去

$ iperf -c 192.168.1.10

------------------------------------------------------------

Client connecting to 192.168.1.10, TCP port 5001

TCP window size: 18.6 KByte (default)

------------------------------------------------------------

[ 3] local 192.168.1.9 port 60611 connected with 192.168.1.10 port 5001

[ ID] Interval Transfer Bandwidth

[ 3] 0.0-10.0 sec 112 MBytes 93.5 Mbits/sec

可以看到 连接速率是 93.5Mbps 局域网一般达不到全速。

另外还有个小工具 用来查看实时的传输速率 httperf

$ sudo apt-get install httperf

$ httperf

httperf --client=0/1 --server=localhost --port=80 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=1 --num-calls=1

httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE

Maximum connect burst length: 0

Total: connections 1 requests 1 replies 1 test-duration 0.001 s

Connection rate: 1081.0 conn/s (0.9 ms/conn, <=1 concurrent connections)

Connection time [ms]: min 0.9 avg 0.9 max 0.9 median 0.5 stddev 0.0

Connection time [ms]: connect 0.2

Connection length [replies/conn]: 1.000

Request rate: 1081.0 req/s (0.9 ms/req)

Request size [B]: 62.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)

Reply time [ms]: response 0.7 transfer 0.0

Reply size [B]: header 284.0 content 177.0 footer 0.0 (total 461.0)

Reply status: 1xx=0 2xx=1 3xx=0 4xx=0 5xx=0

CPU time [s]: user 0.00 system 0.00 (user 0.0% system 432.4% total 432.4%)

Net I/O: 552.1 KB/s (4.5*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0

Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

可以看到目前的网络IO 是 552.1KB/s 大约等于 4.5Mbps

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值