Test Network Speed using your own Server

Using iperf3 to test network speed between machines

Problem

Checking your internet speed against one of the many internet speed sites has some problems:

  1. It relies on their server having a strong connection/low load
  2. It doesn't tell you how fast the connection will be to your own VPS servers
  3. Does not allow you to test your WiFi speed in isolation (only WiFi + outside internet)

Solution

The solution to these problems is to run a speed test between two of your machines. You can then decide to run it against your own VPS (for a broad internet speed test) or against a machine on the local network (to test WiFi speed).

For this I use the iperf3 command. It needs to be run on one machine in server mode and in client mode on another. The process will then start running a speed test between the two instances.

Details

To run in server mode:

iperf3 -s

To run in client mode:

iperf3 -c <server ip>

Once the client starts it will immediately start a speed test against that server.

The output will look something like:

[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  6.11 MBytes  51.3 Mbits/sec   97    331 KBytes
[  5]   1.00-2.00   sec  6.46 MBytes  54.2 Mbits/sec    0    360 KBytes
[  5]   2.00-3.00   sec  6.52 MBytes  54.7 Mbits/sec    0    378 KBytes
[  5]   3.00-4.00   sec  7.26 MBytes  60.9 Mbits/sec    0    386 KBytes
[  5]   4.00-5.00   sec  6.52 MBytes  54.7 Mbits/sec    0    389 KBytes

The -t flag can be used to control how long to run the test for (default 10 seconds).