Using iperf multi-stream may not work as expected

Running iperf with parallel threads

TL;DR – When running iperf with parallel threads/workers the -P option must be specified after the -c <target-IP> option. This is mentioned in the manpage but some options (-t for instance) work in any order, while others (specifically the -P for parallel threads) definitely does not, which is a bit confusing.

For example – these two invocations of iperf give very different results

  • iperf -P 5 -c 10.56.68.97 (The -P before -c) -Yields 20.4 Gbits/sec
  • iperf -c 10.56.68.97 -P 5 (The -P after the -c)- Yields 78.3 Gbits/sec

iperf output

If you are familiar with iperf and are running the command interactively, then it will be obvious when the command is not running in parallel because the output is different

Parallel execution
~$ iperf -c 10.56.68.97 -P 5
------------------------------------------------------------
Client connecting to 10.56.68.97, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 10.56.68.96 port 40710 connected with 10.56.68.97 port 5001 (icwnd/mss/irtt=14/1460/162)
[  3] local 10.56.68.96 port 40708 connected with 10.56.68.97 port 5001 (icwnd/mss/irtt=14/1460/180)
[  2] local 10.56.68.96 port 40704 connected with 10.56.68.97 port 5001 (icwnd/mss/irtt=14/1460/161)
[  4] local 10.56.68.96 port 40706 connected with 10.56.68.97 port 5001 (icwnd/mss/irtt=14/1460/133)
[  5] local 10.56.68.96 port 40738 connected with 10.56.68.97 port 5001 (icwnd/mss/irtt=14/1460/135)
[ ID] Interval       Transfer     Bandwidth
[  2] 0.00-10.02 sec  11.7 GBytes  10.0 Gbits/sec
[  4] 0.00-10.02 sec  21.6 GBytes  18.5 Gbits/sec
[  5] 0.00-10.02 sec  10.8 GBytes  9.27 Gbits/sec
[  1] 0.00-10.02 sec  24.3 GBytes  20.8 Gbits/sec
[  3] 0.00-10.02 sec  22.9 GBytes  19.6 Gbits/sec
[SUM] 0.00-10.00 sec  91.2 GBytes  78.3 Gbits/sec
Non-Parallel execution
$ iperf  -P 5 -c 10.56.68.97
------------------------------------------------------------
Client connecting to 10.56.68.97, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  1] local 10.56.68.96 port 47554 connected with 10.56.68.97 port 5001 (icwnd/mss/irtt=14/1460/144)
[ ID] Interval       Transfer     Bandwidth
[  1] 0.00-10.00 sec  23.8 GBytes  20.4 Gbits/sec

but if you are not familiar/not running interactively- then iperf may execute differently than how you intended.

Leave a Comment