iperf3测速
iperf是专业的网络测速工具。目前大版本是3,因此命令行工具是 iperf3。
iperf3测速分服务端和客户端,两台机器上均需安装iperf3:
安装:
# CentOS系统安装
yum install -y iperf3
# Ubuntu/Debian系统
apt install -y iperf3
接着启动服务端,并放行端口:
iperf3 -s
# iperf3默认监听5201端口,如果想换成其他端口请用-p参数:
# iperf3 -p 8000 -s
# 记得放行防火墙
firewall-cmd --add-port=5201/tcp
客户端连接到服务端测速:
iperf3 -c 服务器ip
# 如果服务端端口不是5201,使用-p选项指定
# iperf3 -c 服务器ip -p 服务器端口
测速过程中服务端和客户端输出差不多,以下是客户端的一个示例输出:
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 974 KBytes 7.98 Mbits/sec 1 147 KBytes
[ 4] 1.00-2.00 sec 5.97 MBytes 50.0 Mbits/sec 135 1.87 MBytes
[ 4] 2.00-3.00 sec 9.87 MBytes 82.6 Mbits/sec 264 5.98 MBytes
[ 4] 3.00-4.00 sec 7.43 MBytes 62.4 Mbits/sec 171 3.07 MBytes
[ 4] 4.00-5.00 sec 11.0 MBytes 92.0 Mbits/sec 55 6.17 MBytes
[ 4] 5.00-6.00 sec 12.1 MBytes 101 Mbits/sec 115 5.42 MBytes
[ 4] 6.00-7.00 sec 10.9 MBytes 91.6 Mbits/sec 77 5.42 MBytes
[ 4] 7.00-8.00 sec 8.62 MBytes 72.3 Mbits/sec 301 2.11 MBytes
[ 4] 8.00-9.00 sec 9.77 MBytes 81.9 Mbits/sec 175 5.27 MBytes
[ 4] 9.00-10.00 sec 9.70 MBytes 81.4 Mbits/sec 151 5.09 MByte
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 86.3 MBytes 72.4 Mbits/sec 1445 sender
[ 4] 0.00-10.00 sec 85.8 MBytes 72.0 Mbits/sec receiver
iperf Done.