Home Server, Software • Testing your internet connection speed from the commandline

Testing your internet connection speed from the commandline

 - 

speedometer
Sometimes you may want to check the internet connection of the provider you are connected to. Although there are various versions that are browser related I rather want to have a method like this commandline based.

There is always the method of downloading a large file off the internet to see how fast it performs, but it’s not very convenient. Upon some searching I came across the tool “speedtest-cli” which is able to perform such speedtests directly from the commandline.

Requirements:
Speedtest-cli is a python program and can be installed using pip. If you don’t have pip installed you can install it with the commands below:

Debian/Ubuntu:
apt-get install python-pip

CentOS/RedHat:
yum install python-pip

ArchLinux:
pacman -Sy python-pip

Installing speedtest-cli:
When pip is installed, run the following to install it:
pip install speedtest-cli

The output will be like:
Collecting speedtest-cli
Using cached speedtest_cli-0.3.4-py2.py3-none-any.whl
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-0.3.4

Using speedtest-cli
Now that it is installed, you can simply start it by running:
speedtest-cli

It will automatically determine the nearest mirror and start the test. Output will be like it is below (IP masked):
[fileserver ~]# speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Ziggo (1.2.3.4)...
Selecting best server based on latency...
b'Hosted by INTERACTIVE 3D B.V. (Rotterdam) [14.50 km]: 16.043 ms'
Testing download speed........................................
Download: 236.53 Mbit/s
Testing upload speed..................................................
Upload: 27.37 Mbit/s

I have a 300/30Mbit internet connection at home and had some downloads ongoing at that time, so the results are what I’ve expected from it.

Author:langerak

2 responses to “Testing your internet connection speed from the commandline”

  • Kevin 01-03-2017 at 04:22 Reply 

    Hi

    Please help to install speedtest in juniper device


    • langerak 11-04-2017 at 15:19 Reply 

      Hi,

      I don’t exactly know what you want to achieve here, can you explain a bit more on this?

      Kind regards,

      Jeffrey Langerak


Leave a Reply

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

*

*