Howto network benchmark with "iperf"

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

Howto network benchmark with "iperf"

Post by peter_b »

Here's an excellent article by the Thomas Krenn crew about benchmarking network performance using iperf (German).

Here's a short summary of how to quickly run a TCP test between 2 machines:

Server1: Start listening.

Code: Select all

$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
------------------------------------------------------------
Server2: Connect to Server1

Code: Select all

$ iperf -c $SERVER1
------------------------------------------------------------
Client connecting to zehn2, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.0.51 port 46532 connected with 10.0.0.52 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 10.7 GBytes 9.20 Gbits/sec

Server2 after finished test:
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
------------------------------------------------------------
[ 4] local 10.0.0.51 port 5001 connected with 10.0.0.52 port 55842
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.0 sec 10.8 GBytes 9.25 Gbits/sec
That's it in a tiny nutshell.
Last edited by peter_b on Thu Oct 22, 2020 12:58 am, edited 1 time in total.
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

HowTo: Test / verify jumbo frames (MTU 9000)

Post by peter_b »

Output 10 intermediate test results and the MTU size at the end:

Code: Select all

$ iperf -c SERVER1 -i1 -t 10 -m
Here's an example what this could look like:
------------------------------------------------------------
Client connecting to zehn2, TCP port 5001
TCP window size: 325 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.0.51 port 46810 connected with 10.0.0.52 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 1.08 GBytes 9.32 Gbits/sec
[ 3] 1.0- 2.0 sec 1.02 GBytes 8.78 Gbits/sec
[ 3] 2.0- 3.0 sec 1.06 GBytes 9.15 Gbits/sec
[ 3] 3.0- 4.0 sec 1.15 GBytes 9.90 Gbits/sec
[ 3] 4.0- 5.0 sec 1.15 GBytes 9.90 Gbits/sec
[ 3] 5.0- 6.0 sec 1.15 GBytes 9.90 Gbits/sec
[ 3] 6.0- 7.0 sec 1.03 GBytes 8.84 Gbits/sec
[ 3] 7.0- 8.0 sec 1.15 GBytes 9.90 Gbits/sec
[ 3] 8.0- 9.0 sec 1.15 GBytes 9.90 Gbits/sec
[ 3] 9.0-10.0 sec 1.15 GBytes 9.90 Gbits/sec
[ 3] 0.0-10.0 sec 11.1 GBytes 9.55 Gbits/sec
[ 3] MSS size 8948 bytes (MTU 8988 bytes, unknown interface)
See the "MTU 8988 bytes" in the last line?
It's almost 1am in the morning, so off by 12 bytes is fine with me for now. :D :wink:
Post Reply