网络性能带宽压测

一、iperf3工具
作用:是一款网络测试工具,可以测试网络的最大吞吐量,比特率、重发包数还有拥塞包大小等,是一款极其轻便,简单易用的一款测试工具。并且提供多平台的支持,支持Linux、Windows、Android、Mac、Iphone等平台。

二、iperf3相关参数说明
1、常规使用参数

参数描述
-p指定服务器监听的端口以及客户端连接的端口,这个端口要求在服务端和客户端保持一致,默认是5201
-V更详细的输出
–logfile file将输出发送到日志文件。

2、服务端特定参数

-s在服务器模式下运行 iPerf
-D后台运行

3、客户端命令行

-c表示远程服务器的IP地址;
-p表示远程服务器的端口号;默认5201
-t参数可以指定传输测试的持续时间,Iperf在指定的时间内,重复的发送指定长度的数据包,默认是10s
-i设置每次报告之间的时间间隔,单位为秒,如果设置为非零值,就会按照此时间间隔输出测试报告,默认值为零;
–logfile参数可以将输出的测试结果储存至文件中.
-P网卡队列数;网卡多线程
-b指定UDP模式使用的带宽,单位bits/sec,默认值是1 Mbit/sec。

三、实验准备
本次实验使用linux系统测试机器;
1、server端192.168.1.2
2、client端192.168.1.1
注意:操作前,请关闭防火墙、安全组类的策略;两台服务器相互全部放开;

3、安装iperf3(两台都安装)

yum -y install iperf3

4、查看iperf3版本

iperf3 --version
iperf 3.1.7
Linux client 4.19.91-26.al7.x86_64 #1 SMP Tue May 24 12:11:55 CST 2022 x86_64
Optional features available: CPU affinity setting, IPv6 flow label, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing

5、测试

【服务端执行】:
[root@server netperf]# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.1.1, port 58358
[  5] local 192.168.1.2 port 5201 connected to 192.168.1.1 port 58360
[  7] local 192.168.1.2 port 5201 connected to 192.168.1.1 port 58362
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec   222 MBytes  1.87 Gbits/sec                  
[  7]   0.00-1.00   sec   222 MBytes  1.87 Gbits/sec                  
[SUM]   0.00-1.00   sec   445 MBytes  3.73 Gbits/sec  

【客户端执行】:
[root@client netperf]# iperf3 -c 192.168.1.2 -b 2048M -t 300 -P 2 
Connecting to host 192.168.1.2, port 5201
[  4] local 192.168.1.1 port 58360 connected to 192.168.1.2 port 5201
[  6] local 192.168.1.1 port 58362 connected to 192.168.1.2 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   222 MBytes  1.87 Gbits/sec  659   1.13 MBytes       
[  6]   0.00-1.00   sec   222 MBytes  1.87 Gbits/sec  578    894 KBytes       
[SUM]   0.00-1.00   sec   445 MBytes  3.73 Gbits/sec  1237             
- - - - - - - - - - - - - - - - - - - - - - - - -
[  4]   1.00-2.00   sec   245 MBytes  2.06 Gbits/sec    0   1.22 MBytes       
[  6]   1.00-2.00   sec   245 MBytes  2.05 Gbits/sec    0   1005 KBytes       
[SUM]   1.00-2.00   sec   490 MBytes  4.11 Gbits/sec    0             
- - - - - - - - - - - - - - - - - - - - - - - - -

参数说明:
如何查看服务端的网卡队列数:ethtool -l eth0获取;其中的Combined值代表网卡队列数

[root@server netperf]# ethtool -l eth0
Channel parameters for eth0:
Pre-set maximums:
RX:		0
TX:		0
Other:		0
Combined:	2
Current hardware settings:
RX:		0
TX:		0
Other:		0
Combined:	2

6、结果分析解释;只需要关注sum行即可

参数说明
Interval测试时间
Transfer数据传输量,分为 sender 发送量与 receiver 接收量
Bandwidth带宽,分为 sender 发送带宽与 receiver 接收带宽
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值