Test internet speed from the Command-line

You probably have heard and tried using speedtest.net to test you computer or smartphone internet speed. If you have your own server or VPS you can also test internet speed connection from the command-line using the speedtest-cli utility. On this tutorial, I’ll show how to install and use speedtest-cli to test your internet speed.

Install speedtest-cli package

You can search for the speedtest package from yum:

~]# yum search speedtest
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
================N/S matched: speedtest =================
python2-speedtest-cli.noarch : Command line interface for testing
: internet bandwidth using speedtest.net

Name and summary matches only, use “search all” for everything.

Now install the packageĀ python2-speedtest-cli

~]# yum install python2-speedtest-cli.noarch
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
epel/x86_64/metalink | 8.2 kB 00:00:00
rhui-REGION-client-config-server-7 | 2.9 kB 00:00:00
rhui-REGION-rhel-server-optional | 3.5 kB 00:00:00
rhui-REGION-rhel-server-releases | 3.5 kB 00:00:00
rhui-REGION-rhel-server-rh-common | 3.8 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package python2-speedtest-cli.noarch 0:1.0.2-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================
Package Arch Version Repository Size
============================================
Installing:
python2-speedtest-cli noarch 1.0.2-1.el7 epel 40 k

Transaction Summary
=========================================================
Install 1 Package

Total download size: 40 k
Installed size: 119 k
Is this ok [y/d/N]: y
Downloading packages:
python2-speedtest-cli-1.0.2-1.el7.noarch.rpm | 40 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python2-speedtest-cli-1.0.2-1.el7.noarch 1/1
Verifying : python2-speedtest-cli-1.0.2-1.el7.noarch 1/1

Installed:
python2-speedtest-cli.noarch 0:1.0.2-1.el7

Complete!

Using Speedtest-cli

You can test the internet speed of your server just by running the command.

~]# speedtest-cli
Retrieving speedtest.net configuration...
Testing from Amazon (54.xx.xx.xx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Viewqwest Pte Ltd (Singapore) [6.48 km]: 2.159 ms
Testing download speed............................................................
Download: 410.14 Mbit/s
Testing upload speed..................................................................
Upload: 558.01 Mbit/s

You can view the many options of speedtest-cli using the -h option. FOr example if you want to choose a testing server, you use the –list to server listing and –server to choose it.

~]# speedtest --list
4044) SoftLayer Technologies, Inc. (Singapore, Republic of Singapore) [6.48 km]
2054) Viewqwest Pte Ltd (Singapore, Republic of Singapore) [6.48 km]
367) NewMedia Express (Singapore, Republic of Singapore) [6.48 km]
3914) SingTel (Singapore, Republic of Singapore) [6.48 km]
1883) Telin (Singapore, Republic of Singapore) [6.48 km]
....
....
~]# speedtest --server 4044
Retrieving speedtest.net configuration...
Testing from Amazon (54.xx.xx.xx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by SoftLayer Technologies, Inc. (Singapore) [6.48 km]: 5.326 ms
Testing download speed....................................................................
Download: 465.71 Mbit/s

Testing upload speed....................................................................................................
Upload: 508.73 Mbit/s

And you’re done testing your server’s internet speed now.


– masterkenneth

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *