一、iperf
二进制包下载地址:https://iperf.fr/iperf-download.php
iperf是一个网络性能测试工具。iperf可以测试TCP和UDP带宽质量。iperf可以测量最大TCP带宽,具有多种参数和UDP特性。iperf可以报告带宽,延迟抖动和数据包丢失。利用iperf这一特性,可以用来测试一些网络设备如路由器,防火墙,交换机等的性能。
##服务端10.74.148.74启动iperf3,监听端口12345,请求间断时间1s
[root@host-192-168-1-76 ~]# iperf3 -s -p 12345 -i 1
-----------------------------------------------------------
Server listening on 12345
-----------------------------------------------------------
Accepted connection from 10.74.165.229, port 45368
[ 5] local 192.168.1.76 port 12345 connected to 10.74.165.229 port 45370
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 10.6 MBytes 88.5 Mbits/sec
[ 5] 1.00-2.00 sec 10.8 MBytes 90.7 Mbits/sec
[ 5] 2.00-3.00 sec 10.9 MBytes 91.5 Mbits/sec
[ 5] 3.00-4.00 sec 10.2 MBytes 85.5 Mbits/sec
[ 5] 4.00-5.00 sec 9.92 MBytes 83.2 Mbits/sec
[ 5] 5.00-6.00 sec 10.1 MBytes 84.4 Mbits/sec
[ 5] 6.00-7.00 sec 10.0 MBytes 84.1 Mbits/sec
[ 5] 7.00-8.00 sec 10.2 MBytes 85.6 Mbits/sec
[ 5] 8.00-9.00 sec 10.2 MBytes 86.0 Mbits/sec
[ 5] 9.00-10.00 sec 10.4 MBytes 87.0 Mbits/sec
[ 5] 10.00-10.05 sec 492 KBytes 87.0 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.05 sec 0.00 Bytes 0.00 bits/sec sender
[ 5] 0.00-10.05 sec 104 MBytes 86.7 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 12345
-----------------------------------------------------------
##客户端向10.74.148.74发起请求,请求间断时间1s,测试时间长度10s
[root@paas-controller-20-20-20-106:/home/ubuntu]$ iperf3 -c 10.74.148.74 -p 12345 -i 1 -t 10
Connecting to host 10.74.148.74, port 12345
[ 4] local 10.10.10.19 port 45370 connected to 10.74.148.74 port 12345
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 13.4 MBytes 113 Mbits/sec 60 203 KBytes
[ 4] 1.00-2.00 sec 10.8 MBytes 90.6 Mbits/sec 32 186 KBytes
[ 4] 2.00-3.00 sec 10.9 MBytes 91.6 Mbits/sec 63 141 KBytes
[ 4] 3.00-4.00 sec 10.1 MBytes 84.9 Mbits/sec 93 72.4 KBytes
[ 4] 4.00-5.00 sec 9.93 MBytes 83.3 Mbits/sec 28 112 KBytes
[ 4] 5.00-6.00 sec 10.1 MBytes 84.6 Mbits/sec 75 86.9 KBytes
[ 4] 6.00-7.00 sec 10.0 MBytes 84.2 Mbits/sec 28 115 KBytes
[ 4] 7.00-8.00 sec 10.2 MBytes 85.4 Mbits/sec 47 112 KBytes
[ 4] 8.00-9.00 sec 10.2 MBytes 85.9 Mbits/sec 57 94.8 KBytes
[ 4] 9.00-10.00 sec 10.4 MBytes 87.5 Mbits/sec 32 121 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 106 MBytes 89.1 Mbits/sec 515 sender
[ 4] 0.00-10.00 sec 104 MBytes 87.1 Mbits/sec receiver
iperf Done.
参考:
https://www.huaweicloud.com/articles/4e105744e3627791d6ae5f16d2bcc912.html