Internet speedtest from the CLI

Share your own howto's etc. Not for support questions!

Internet speedtest from the CLI

Postby Hallvor » 2017-09-16 20:31

Why use it?

This application is nice if you want to monitor your broadband connection from the CLI. This makes it ideal for headless servers.

Many of you might have tried the web page: http://beta.speedtest.net/ It should give you the same result.


Installation
Simply install it by typing:
Code: Select all
# apt-get install speedtest-cli


Using it
We can now launch the application from the CLI by typing, as regular user:

Code: Select all
$ speedtest-cli


Speedtest will select the server with the lowest ping and give you the results, like this:

Code: Select all
hallvor@debian-hp:~$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from HomeNet (XX.XX.XX.XX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Telenor A/S (Aalborg) [168.97 km]: 50.952 ms
Testing download speed................................................................................
Download: 20.07 Mbit/s                                                                                                                                                                         
Testing upload speed....................................................................................................                                                                       
Upload: 17.97 Mbit/s                                                                                                                                                                           
hallvor@debian-hp:~$


Not very impressive... :roll:
HP Elitebook 2570p, Intel Core i5 3320-M CPU @ 2.60 GHz, 6 GB RAM, Intel HD 4000 graphics, 240 GB SSD, Debian Stretch (KDE)
User avatar
Hallvor
 
Posts: 843
Joined: 2009-04-16 18:35
Location: Norway

Re: Internet speedtest from the CLI

Postby Bulkley » 2017-09-16 21:34

Nice idea. Thanks.

Does speedtest-cli need Flash? The one on the web site does. I've been using Speed of Me which uses HTML5.
Bulkley
 
Posts: 5626
Joined: 2006-02-11 18:35

Re: Internet speedtest from the CLI

Postby Ardouos » 2017-09-16 21:54

Bulkley wrote:Nice idea. Thanks.

Does speedtest-cli need Flash?


Nope :)
User avatar
Ardouos
 
Posts: 1009
Joined: 2013-11-03 00:30
Location: Elicoor II

Re: Internet speedtest from the CLI

Postby Bulkley » 2017-09-17 02:07

Speedtest CLI is fast!

Code: Select all
Selecting best server based on ping...
Hosted by Monashee Mountain Multimedia (Revelstoke, BC) [196.14 km]: 61.974 ms
Testing download speed................................................................................
Download: 5.79 Mbit/s
Testing upload speed....................................................................................................
Upload: 1.00 Mbit/s


Yes, I know it's slow but Internet is expensive here and I can live with this.
Bulkley
 
Posts: 5626
Joined: 2006-02-11 18:35

Re: Internet speedtest from the CLI

Postby RU55EL » 2017-09-17 05:00

Nice! Thanks for the thread!

Code: Select all
russel@debian-nuc:~$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from SimpleLink (xxx.xxx.xx.xx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Line Systems (West Chester, PA) [137.61 km]: 83.369 ms
Testing download speed................................................................................
Download: 10.70 Mbit/s
Testing upload speed....................................................................................................
Upload: 21.33 Mbit/s


interesting that my upload speed is about double the download speed.
User avatar
RU55EL
 
Posts: 380
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Internet speedtest from the CLI

Postby alan stone » 2017-09-17 07:12

RU55EL wrote:interesting that my upload speed is about double the download speed.

:oops: Is your ISP located south of where you are? :oops:
Debian 8.10 32bit, WM: Openbox
If everyone is thinking alike then somebody isn't thinking. - George S. Patton
User avatar
alan stone
 
Posts: 256
Joined: 2011-10-22 14:08
Location: In my body.

Re: Internet speedtest from the CLI

Postby kedaha » 2017-09-17 08:05

Very nice! Thanks very much for the post. I've just tried it on my headless server:
Code: Select all
user@server:~$ speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from ****** (**.***.***.***)...
Selecting best server based on latency...
Hosted by wilhelm.tel (Norderstedt) [18.59 km]: 22.128 ms
Testing download speed........................................
Download: 93.44 Mbits/s
Testing upload speed..................................................
Upload: 79.99 Mbits/s

Not bad at all!
Mate DE & OSSv4.
LaMp, WordPress; ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 2867
Joined: 2008-05-24 12:26

Re: Internet speedtest from the CLI

Postby RU55EL » 2017-09-17 14:39

alan stone wrote:
RU55EL wrote:interesting that my upload speed is about double the download speed.

:oops: Is your ISP located south of where you are? :oops:


Not anymore:
Code: Select all
russel@debian-nuc:~$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from SimpleLink (xxx.xxx.xx.xx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Comcast (Baltimore, MD) [139.59 km]: 103.526 ms
Testing download speed................................................................................
Download: 9.94 Mbit/s
Testing upload speed....................................................................................................
Upload: 22.92 Mbit/s


[edit]
It seems to be balanced at work:
Code: Select all
russel@NUC-G:~$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from SimpleLink (xxx.xxx.xx.xx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Hotwire Fision (Philadelphia, PA) [130.72 km]: 78.648 ms
Testing download speed................................................................................
Download: 18.00 Mbit/s
Testing upload speed....................................................................................................
Upload: 18.67 Mbit/s

[/edit]
User avatar
RU55EL
 
Posts: 380
Joined: 2014-04-07 03:42
Location: /home/russel

Re: Internet speedtest from the CLI

Postby gusnov » 2018-01-27 03:33

thank u, its work bro :)
gusnov
 
Posts: 1
Joined: 2018-01-27 03:02

Re: Internet speedtest from the CLI

Postby sunrat » 2018-01-27 23:55

Be aware of the section titled "Inconsistency" at https://github.com/sivel/speedtest-cli
I just tested with both speedtest-cli and Speedtest beta and got similar download speeds but very different ping and upload. This was expected as I also recently compared 4 web-based test sites and got different results every time even with multiple consecutive uses of the same test.
Bottom line is speed tests will only give ball-park results.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2451
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Internet speedtest from the CLI

Postby jppattison » 2018-02-12 01:06

Thanks Hallvor, I was wondering if we were getting what we were promised - I don't think so ....
Code: Select all
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by xxxxx(Billings, MT) [73.05 km]: xxxxxx
Testing download speed................................................................................
Download: 7.58 Mbit/s
Testing upload speed....................................................................................................
Upload: 1.53 Mbit/s

Billings is south of us by about 110 miles! pretty slow on the upload!
jppattison
 
Posts: 42
Joined: 2015-02-23 18:13

Re: Internet speedtest from the CLI

Postby Thorny » 2018-02-12 09:42

jppattison wrote:..., I was wondering if we were getting what we were promised - I don't think so ....

You should double check your terms of service, generally they list speeds as up to, since many things can affect actual speed at any given time. Internet congestion, busy server that you are communicating with, rerouteing due to hardware issues on the shortest path, others. Even things like time of day can matter. It is often on non-commercial accounts that upload is significantly lower than download speed.
User avatar
Thorny
 
Posts: 542
Joined: 2011-02-27 13:40

Re: Internet speedtest from the CLI

Postby DBNLNX » 2018-07-02 15:18

If you add --server xxxx it can test speed against server you choose.
Here you can find server list - https://www.speedtestserver.com

root@Debian:/home/debian/speedtest# ./speedtest-cli --server 1234
Retrieving speedtest.net configuration...
Testing from XXX (xxx.xxx.xxx.xxx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by XXX [312.63 km]: 11.086 ms
Testing download speed................................................................................
Download: 817.73 Mbit/s
Testing upload speed................................................................................................
Upload: 81.22 Mbit/s
DBNLNX
 
Posts: 5
Joined: 2018-07-02 14:51


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable
cron