网络性能测试 iperf3

  • iperf3是一个测试网络带宽的工具,通过简单的设置,即可很直观的反应网络的链接带宽.

1.1 apt-get在线安装

apt-get install iperf3 -y

1.2 使用deb包离线安装

可以尝试安装官方提供的deb包.

wget https://iperf.fr/download/ubuntu/iperf3_3.1.3-1_amd64.deb
wget https://iperf.fr/download/ubuntu/libiperf0_3.1.3-1_amd64.deb
dpkg -i iperf3_3.1.3-1_amd64.deb libiperf0_3.1.3-1_amd64.deb

2.1 首先启动服务端

iperf3 -s

2.2 启动客户端

假设服务端的ip为192.168.1.2

iperf3 -c 192.168.1.2 -t 60 -V

常用参数:

  • -c 指定运行为客户端
  • -t 运行时长
  • -V 显示详情
  • -P 并发数设置
  • –logfile 输出日志到文件
  • -n –bytes n[KM]
    • number of bytes to transmit (instead of -t)
  • -F, –file name
    • client-side: read from the file and write to the network, instead of using random data;
    • server-side: read from the network and write to the file, instead of throwing the data away

2.3 测试结果样例

Connecting to host 10.1.2.14, port 5201
[  4] local 10.1.2.12 port 46488 connected to 10.1.2.14 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  1.09 GBytes  9.35 Gbits/sec   13    655 KBytes
[  4]   1.00-2.00   sec  1.10 GBytes  9.41 Gbits/sec    0    757 KBytes
[  4]   2.00-3.00   sec  1.10 GBytes  9.41 Gbits/sec    0    802 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-3.00   sec  3.28 GBytes  9.39 Gbits/sec   13             sender
[  4]   0.00-3.00   sec  3.28 GBytes  9.38 Gbits/sec                  receiver

iperf Done.

2.4 高级用法

man iperf3.

  • linux/performance/网络性能测试_iperf3.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)