我目前正在测试 iperf,以期为我们公司自动化一些测试服务器。
为此,我在云中使用了 iperf 服务器,该服务器连接良好,距我的客户端仅 5 跳。用于启动服务器的命令是“iperf3 -s”。
我的客户连接到一条低质量的 ADSL 线路,我从长期测试中得知该线路的可用带宽在 500k 到 1500k 之间。
我正在使用各种测试类型进行测试。例如,当我使用 TCP 和默认设置进行测试时,我得到以下输出:
iperf3 -c xxxxxxx.co.uk
Connecting to host xxxxxxx.co.uk, port 5201
[ 4] local 192.168.1.102 port 56608 connected to x.x.x.x port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 95.0 KBytes 778 Kbits/sec 0 16.8 KBytes
[ 4] 1.00-2.00 sec 85.2 KBytes 698 Kbits/sec 0 20.9 KBytes
[ 4] 2.00-3.00 sec 79.6 KBytes 652 Kbits/sec 0 25.1 KBytes
[ 4] 3.00-4.00 sec 74.0 KBytes 607 Kbits/sec 3 19.6 KBytes
[ 4] 4.00-5.00 sec 72.6 KBytes 595 Kbits/sec 0 25.1 KBytes
[ 4] 5.00-6.00 sec 71.2 KBytes 583 Kbits/sec 2 19.6 KBytes
[ 4] 6.00-7.00 sec 61.4 KBytes 503 Kbits/sec 1 19.6 KBytes
[ 4] 7.00-8.00 sec 82.4 KBytes 675 Kbits/sec 0 19.6 KBytes
[ 4] 8.00-9.00 sec 71.2 KBytes 583 Kbits/sec 1 12.6 KBytes
[ 4] 9.00-10.00 sec 72.6 KBytes 595 Kbits/sec 0 19.6 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 765 KBytes 627 Kbits/sec 7 sender
[ 4] 0.00-10.00 sec 735 KBytes 602 Kbits/sec receiver
iperf Done.
这比我预期的要低一点,但我可以接受它大体上是正确的。
当我想测试 udp 性能时,事情变得很奇怪。
如果我使用以下命令测试默认 udp 带宽:iperf3 -c xxxxxxxxx.co.uk -u
我得到以下输出:
Connecting to host xxxxxxxxx.co.uk, port 5201
[ 4] local 192.168.1.102 port 41387 connected to x.x.x.x port 5201
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 5.00-6.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 6.00-7.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 7.00-8.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 8.00-9.00 sec 128 KBytes 1.05 Mbits/sec 16
[ 4] 9.00-10.00 sec 128 KBytes 1.05 Mbits/sec 16
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 1.25 MBytes 1.05 Mbits/sec 11.913 ms 136/146 (93%)
[ 4] Sent 146 datagrams
iperf Done.
但是,如果我将带宽设置为 100M,请使用以下命令:
iperf3 -c xxxxxxxx.co.uk -u -b 100M
我得到
Connecting to host xxxxxxx.co.uk, port 5201
[ 4] local 192.168.1.102 port 53077 connected to x.x.x.x port 5201
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 10.5 MBytes 87.9 Mbits/sec 1342
[ 4] 1.00-2.00 sec 10.8 MBytes 90.3 Mbits/sec 1378
[ 4] 2.00-3.00 sec 10.8 MBytes 90.6 Mbits/sec 1382
[ 4] 3.00-4.00 sec 10.8 MBytes 90.8 Mbits/sec 1386
[ 4] 4.00-5.00 sec 10.8 MBytes 90.2 Mbits/sec 1376
[ 4] 5.00-6.00 sec 10.8 MBytes 90.2 Mbits/sec 1376
[ 4] 6.00-7.00 sec 10.8 MBytes 90.3 Mbits/sec 1378
[ 4] 7.00-8.00 sec 10.8 MBytes 90.8 Mbits/sec 1384
[ 4] 8.00-9.00 sec 10.8 MBytes 90.7 Mbits/sec 1384
[ 4] 9.00-10.00 sec 10.8 MBytes 90.5 Mbits/sec 1381
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 108 MBytes 90.2 Mbits/sec 8.214 ms 0/1 (0%)
[ 4] Sent 1 datagrams
iperf Done.
这太疯狂了。我不可能在这条 ADSL 线路上达到 90 Mbits/sec。任何人都可以帮助阐明这一点吗?