Iperf3 网络性能工具

下载地址:
https://iperf.fr/iperf-download.php

官方文档:https://iperf.fr/iperf-doc.php

服务端监听

iperf3 -s

-s代表服务端,运行结果

[cloud@t-spider-s-002 ~]$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

网络测试

# 带宽测试,采用tcp
neil@ubuntu:~$ iperf3 -c 10.10.14.108
Connecting to host 10.10.14.108, port 5201
[  5] local 192.168.150.131 port 51950 connected to 10.10.14.108 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   109 MBytes   917 Mbits/sec    0    131 KBytes       
[  5]   1.00-2.00   sec   113 MBytes   944 Mbits/sec    0    131 KBytes       
[  5]   2.00-3.00   sec   112 MBytes   937 Mbits/sec    0    131 KBytes       
[  5]   3.00-4.00   sec   112 MBytes   941 Mbits/sec    0    131 KBytes       
[  5]   4.00-5.00   sec   109 MBytes   911 Mbits/sec    0    131 KBytes       
[  5]   5.00-6.00   sec   111 MBytes   934 Mbits/sec    0    131 KBytes       
[  5]   6.00-7.00   sec   113 MBytes   945 Mbits/sec    0    131 KBytes       
[  5]   7.00-8.00   sec   110 MBytes   925 Mbits/sec    0    131 KBytes       
[  5]   8.00-9.00   sec   106 MBytes   888 Mbits/sec    0    131 KBytes       
[  5]   9.00-10.00  sec   112 MBytes   938 Mbits/sec    0    131 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.08 GBytes   928 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.08 GBytes   927 Mbits/sec                  receiver

iperf Done.

# 网络抖动测试
neil@ubuntu:~$ iperf3 -c 10.10.14.108 -u
Connecting to host 10.10.14.108, port 5201
[  5] local 192.168.150.131 port 60162 connected to 10.10.14.108 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   1.00-2.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   2.00-3.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   3.00-4.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   4.00-5.00   sec   127 KBytes  1.04 Mbits/sec  89  
[  5]   5.00-6.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   6.00-7.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   7.00-8.00   sec   128 KBytes  1.05 Mbits/sec  90  
[  5]   8.00-9.00   sec   127 KBytes  1.04 Mbits/sec  89  
[  5]   9.00-10.00  sec   128 KBytes  1.05 Mbits/sec  90  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.000 ms  0/898 (0%)  sender
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.077 ms  0/898 (0%)  receiver

iperf Done.

-c代表为客户端, -u代表udp测试,用于网络抖动测试,输出结果中的Jitter则代表网络抖动的结果。

可能遇到的问题

如果网络连接不了,可能是因为防火墙的原因,centos下的防火墙的常见命令:

firewall-cmd --zone=public --add-port=5672/tcp --permanent   # 开放5672端口

firewall-cmd --zone=public --remove-port=5672/tcp --permanent  #关闭5672端口

firewall-cmd --reload   # 配置立即生效

firewall-cmd --zone=public --list-ports # 查看防火墙所有开放的端口

firewall-cmd --state # 查看防火墙状态

systemctl stop firewalld.service # 关闭防火墙

你可能感兴趣的:(网络,udp,tcp/ip,linux)