Quickly Test Network Speed Between Two Servers

Quickly discovering the speed between two Linux servers can often be a chore of copying large files around.

There is a better way with iperf.

iperf can be used to quickly setup a server and client process on two Linux servers and report the max network throughput between them.

Server

Run the following command on the server machine:

iperf -s -i 10

Client

On the client run the following command:

iperf -i 10 -c <SERVER>

Result

Every 10 seconds the measured network speed will be printed on the client and server. Here is the server’s output on my test machine:

# iperf -s -i 10
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  4] local 1.1.1.1 port 5001 connected with 2.2.2.2 port 36172
[ ID] Interval       Transfer     Bandwidth
[  4] 0.0000-10.0000 sec  2.27 GBytes  1.95 Gbits/sec
[  4] 0.0000-10.0163 sec  2.27 GBytes  1.84 Gbits/sec
[  4] 0.0000-10.0163 sec  2.27 GBytes  1.95 Gbits/sec

I’m getting a speed of ~1.9Gbits/sec between these machines.