Speedtes CLI is a command line interface for testing internet bandwidth using speedtest.net


HOW TO INSTALL SPEEDTEST-CLI

CentOS 7/RHEL/Fedora
yum install python python-setuptools python2-speedtest-cli
Debian/Ubuntu (using the old good apt)
sudo apt-get update && sudo apt-get install iperf3

HOW TO USE SPEEDTEST-CLI

The easiest way of using speedtest-cli, is just by invoking it without options in the terminal. First the application will select the closest available server to test the connection against, then it will display the download and upload speed:

Debian / Ubuntu
root@test:~# speedtest-cli

Retrieving speedtest.net configuration...
Testing from Fishnet Communications LLC (77.73.67.143)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by TRINITY (Mariupol) [1505.65 km]: 59.954 ms
Testing download speed...................................
Download: 182.19 Mbit/s
Testing upload speed.....................................
Upload: 168.31 Mbit/s

One very useful option of speedtest-cli is --share: when using it, a graphical representation of the results of the speed test will be generated and hosted online; the command will return the URL we can use to access and share it:

root@test:~# speedtest-cli --share

Share results: http://www.speedtest.net/result/10259127090.png

By default, the program runs a test against the closest speedtest.net server. If we want to force the test against a specific server, we first have to generate the list of the available ones:

root@test:~# speedtest-cli --list

Retrieving speedtest.net configuration...
 3526) Rostelecom (Pskov, Russian Federation) [609.77 km]
11075) Net By Net Holding LLC (Pskov, Russian Federation) [609.77 km]
27770) Pskovline, LTD (Pskov, Russia) [609.77 km]
29684) Vels Ltd (Ludza, Latvia) [618.83 km]
 1119) MGTS (Minsk, Belarus) [674.23 km]
25480) BYFLY.BY (Minsk, Belarus) [674.23 km]
 4268) Mobile TeleSystems JLLC (Minsk, Belarus) [674.23 km]
30453) Beltelecom Minsk branch (Minsk, Belarus) [674.23 km]
 3704) UNET.BY (Minsk, Belarus) [674.23 km]
10323) JLLC "COSMOS TV" (Minsk, Belarus) [674.23 km]
 1399) DauTKom TV (Daugavpils, Latvia) [692.83 km]
23382) Elevi AS (Tartu, Estonia) [720.05 km]
12265) Cgates (Vilnius, Lithuania) [789.51 km]
 6083) Tele2 (Vilnius, Lithuania) [789.51 km]
22608) M4host (Ogre, Latvia) [810.56 km]
13246) Baltcom (Riga, Latvia) [841.42 km]
 1268) Tet (Riga, Latvia) [841.49 km]
 1348) AS Balticom (Riga, Latvia) [841.49 km]
 2148) Latvijas Mobilais Telefons (Riga, Latvia) [841.49 km]
24231) MīTs LV, SIA (Riga, Latvia) [841.49 km]

The list is quite long, therefore just a part of it is reported here. Now, to test the connection against a specific server, we run the command with the --server option, providing the server ID (which is reported in the first column of the list) as the argument:

root@test:~# speedtest-cli --server 6083

Retrieving speedtest.net configuration...
Testing from SIA Serverum (212.6.44.32)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by Tele2 (Vilnius) [789.51 km]: 37.345 ms
Testing download speed...........................
Download: 450.82 Mbit/s
Testing upload speed.............................
Upload: 629.44 Mbit/s


In this tutorial we saw how to install and use the speedtest-cli application. The program is basically the command line interface equivalent of running a speed test on the https://www.speedtest.net site, and can be very useful when operating on a machine without a graphical server installed.
  • No labels