How to Test the Upload and Download Speed of Your Server
This article will cover how to test a server's upload speed, as well as its download speed. This can be helpful with either benchmarking what your server is capable of or investigating if the server speed is related if your site is running slow.
This article will cover the following topics:
- Why HostGator Recommends Speedtest
- Installing Speedtest
- Running Speedtest
- Using Speedtest to Diagnose Server Issues
Why HostGator Recommends Speedtest
Speedtest.net is a third party with services dedicated to identifying the speed of a connection which will select the best test server based on latency. HostGator recommends using their command line interface tool because this results in a reliable external test connection.
Testing from your local connection is likely to go through firewalls from your network which may not be configured to allow speed testing, and which are likely limited by your local internet connection speed. This would prevent you from knowing the full capacity of the server.
You may also use the web interface for Speedtest.net to test your local internet connection speeds.
Installing Speedtest
Before continuing, you will need to know how to access your server using SSH. Please use the following article to get and use SSH access if you area not already familiar with it:
Once you are able to access your server via SSH use the following instructions to install the Speedtest:
- Log into your server via SSH.
- Run the following command to ensure that you are in your home directory:
cd ~
- Enter the following command to download the speedtest command line interface script:
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
- Next, enter the following command to give the script executable permissions on your server:
chmod +x speedtest-cli
Running Speedtest
After Speedtest is installed, you can run it using the following instructions:
- Log into your server via SSH.
- Run the following command to ensure that you are in your home directory:
cd ~
- Run speedtest with the following command:
./speedtest-cli
You will receive an output similar to the following:
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from WEBSITEWELCOME.COM (192.185.4.141)...
Selecting best server based on latency...
Hosted by T-Mobile (Houston, TX) [13.03 km]: 2.382 ms
Testing download speed........................................
Download: 863.48 Mbit/s
Testing upload speed..................................................
Upload: 242.25 Mbit/s
Because the test is running directly from the server, your upload and download speeds are inverted. The following parts of the output will provide the most important information:
- Hosted by T-Mobile (Houston, TX) [13.03 km]: 2.382 ms: This section tells you which test server was selected and the latency that is available to that test server.
- Download: 863.48 Mbit/s: This section tells you the speed that the test server was able to upload data to your server.
- Upload: 242.25 Mbit/s: This section tells you the speed that the test server was able to download data from your server.
Using Speedtest to Diagnose Server Issues
If you are using Speedtest to diagnose issues with your site, please be aware that other factors can contribute to slow site speeds. This includes, but is not limited to, sites with large numbers of high quality images or sites that require a large amount of CPU processing to render.
However, if you believe the test speeds are low, or if you experience lag while entering commands into the server, you may additionally wish to perform a traceroute test using the tools and methods from our traceroute article:
After you have performed a speed and traceroute test, please keep a record of the results from your tests and provide them to us via phone or chat so that we may assist with diagnosing and resolving any issues.