【工具】快速测试两个服务器之间的带宽

测试

安装iperf3

apt install iperf3

在服务器上开启端口监听

iperf3 -p 2228 -s

监听在2228端口

在终端上访问

这里我们通过localhost测试localhost访问的带宽情况

# 发送指定数据量的数据到服务端
iperf3 -p 2228 -c 127.0.0.1 -n 131072000 -f M
# 一定时间内发送
iperf3 -p 2228 -c 127.0.0.1 -t 3 -f M
说明
-f M按照M为单位显示测速结果
-n131072000 传送131072000个字节
-c以client模式运行
-p指定端口
-t 3运行3s,记录每秒钟的测速结果

示例输出

指定数据量

Accepted connection from 127.0.0.1, port 58346
[  5] local 127.0.0.1 port 2228 connected to 127.0.0.1 port 58348
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-0.10   sec   125 MBytes  10.5 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-0.10   sec   125 MBytes  10.5 Gbits/sec    0             sender
[  5]   0.00-0.10   sec   125 MBytes  10.5 Gbits/sec                  receiver

指定时间

Accepted connection from 127.0.0.1, port 58174
[  5] local 127.0.0.1 port 2228 connected to 127.0.0.1 port 58176
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec  3.19 GBytes  27.4 Gbits/sec
[  5]   1.00-2.00   sec  2.58 GBytes  22.1 Gbits/sec
[  5]   2.00-3.00   sec  4.51 GBytes  38.7 Gbits/sec
[  5]   3.00-3.04   sec   186 MBytes  40.6 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-3.04   sec  10.5 GBytes  29.5 Gbits/sec    0             sender
[  5]   0.00-3.04   sec  10.5 GBytes  29.5 Gbits/sec                  receiver

其他

项目主页

https://github.com/esnet/iperf

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值