iperf测试带宽linux,iperf3-网络带宽性能测试工具

作用:基于TCP或UDP,对网络带宽吞吐量进行测试

安装:yum install iperf3 -y

服务端参数:

-s:表示启动服务端

-i:表示打印报告的时间间隔

-p:指定监听端口,默认为5201

-D:以后台方式运行(默认是前台运行,将测试结果打印在屏幕)

用法示例:iperf3 -s -i 1 -p 10000

客户端参数:

-c:表示启动客户端,后边跟上服务端IP

-b:指定目标的最大带宽(用ethtool 网卡名字可以查看)

-t:指定测试时间

-P:指定并发数

-p:指明服务端启动的端口

-R:逆向测试

-d:双向测试

用法示例:iperf3 -c 192.168.0.30 -b 1G -t 5 -P 2 -p 10000

举例说明:

#启动服务端

[[email protected]~]# iperf3 -s -i 1 -p 10000

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

Server listening on 10000

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

Accepted connection from 192.168.10.121, port 40322

[  5] local 192.168.10.122 port 10000 connected to 192.168.10.121 port 40324

[ ID] Interval           Transfer     Bandwidth

[  5]   0.00-1.00   sec   110 MBytes   926 Mbits/sec

[  5]   1.00-2.00   sec   121 MBytes  1.02 Gbits/sec

[  5]   2.00-3.00   sec   117 MBytes   980 Mbits/sec

[  5]   3.00-4.00   sec   119 MBytes   997 Mbits/sec

[  5]   4.00-5.00   sec   120 MBytes  1.01 Gbits/sec

[  5]   5.00-5.00   sec  0.00 Bytes  0.00 bits/sec

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

[ ID] Interval           Transfer     Bandwidth

[  5]   0.00-5.00   sec  0.00 Bytes  0.00 bits/sec                  sender

[  5]   0.00-5.00   sec   587 MBytes   984 Mbits/sec                  receiver#启动客户端

[[email protected]~]# iperf3 -c 192.168.10.122 -t 5 -b 1G -P 1 -p 10000 -R

Connecting to host 192.168.10.122, port 10000

Reverse mode, remote host 192.168.10.122 is sending

[  4] local 192.168.10.121 port 40328 connected to 192.168.10.122 port 10000

[ ID] Interval           Transfer     Bandwidth

[  4]   0.00-1.00   sec   108 MBytes   909 Mbits/sec

[  4]   1.00-2.00   sec   122 MBytes  1.02 Gbits/sec

[  4]   2.00-3.00   sec   118 MBytes   992 Mbits/sec

[  4]   3.00-4.00   sec   119 MBytes   999 Mbits/sec

[  4]   4.00-5.00   sec   120 MBytes  1.00 Gbits/sec

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

[ ID] Interval           Transfer     Bandwidth       Retr

[  4]   0.00-5.00   sec   587 MBytes   985 Mbits/sec    0             sender

[  4]   0.00-5.00   sec   587 MBytes   985 Mbits/sec                  receiver

可以看到发送方和接收方的Bandwidth(带宽)大概都是985M/s,很接近网卡的1000M/s;

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值