Show Categories
Categories
Understanding how to test your network speed can help you optimize your server's performance and troubleshoot any issues that may arise. In this guide, we will walk you through testing your network speed using terminal commands. However, please note that there are no accurate test results. That’s because each test has two sides.
During the tests, your server gets connected to another server, and therefore, both your server's speed, and the other server’s speed affect the results shown to you. This is why it’s a good idea to do your tests using multiple servers and tools.
One of the most effective ways to test your network speed is by using terminal commands. This method is more accurate than using online websites to do network tests. Also, mastering command line tools allows you to test different aspects of your network, such as download speed, upload speed, and latency.
First and foremost, log in to your Linux server using either SSH or VNC and then choose either of the tools we introduce below to follow along.
The easiest tool to test network speed is the speedtest-cli. This tool uses the Speedtest.net infrastructure to measure network speed and latency, providing a simple and convenient way to test your server's connection. Here's how to use it:
1. Install speedtest-cli
Based on the Linux distro you are using, choose one of the following commands to install speedtest-cli:
2. Running the tests
Once speedtest-cli is installed, you can run a network speed test by simply typing speedtest-cli in the terminal and pressing Enter. This will automatically select the best server based on ping and perform a speed test.
The upload and download speed will then be shown to you
The iperf3 tool is a versatile utility for testing network speed. It works by creating a data stream between a server and a client. Therefore, it allows you to measure the speed between two devices, one which should be a server and the other is the server’s client. Here's a step-by-step guide on how to use it:
1. Installation
Again, based on your Linux distro, use one of the following commands to install iperf3:
2. Running speed tests between two servers using iperf3
Once iperf3 is installed, you can start your own server by running the command iperf3 -s. This will start the iperf3’s server mode. However, this is for when you want to measure the speed between two specific devices that you own.
In our case, we just want to know how good our server’s speed is in general.
3. Choose a public server
To be able to run a general test with iperf3, we can use one of the public iperf3 servers. Here’s a list of them.
Note that each public server has a limited link bandwidth. Therefore, if you choose a server with a 1Gbps link, for example, your test won’t show speed results more than 1Gb, even if your own server has a 10Gbps link attached to it.
You should first sort the servers by their speed, then choose the one closest to you. This is an important factor, as you will definitely experience a huge latency if you don’t choose servers that are close to you.
How can you know which servers are the closest to you? You can ping them and choose one with the lowest latency.
4. Start iperf3 in client mode and run the test
After choosing a public server from iperf3serverlist.net, copy the command that appears in the site’s table. Then, paste that command into your SSH or VNC session.
For example, since I’m using one of Cloudzy’s Frankfort VPSs, I’ll choose a 10Gbps German server among the public servers:
The command above tests uploads. For testing download speed, you should also add a -R to the end of the command:
Regularly testing your network speed is an essential part of managing a VPS. By using tools like iperf3 and speedtest-cli, you can keep a close eye on your server's performance and ensure that it's always running at its best. If you have any questions on running network tests, don’t hesitate to contact us by submitting a ticket.
Operating Systems
Locations
Resources