How to use speedtest-cli for testing internet bandwidth

Posted on
wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest.py
python speedtest.py

An example of result

root@server:~# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
--2020-04-17 18:50:40--  https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.0.133, 151.101.64.133, 151.101.128.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.0.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65018 (63K) [text/plain]
Saving to: 'speedtest.py'

speedtest.py                  100%[================================================>]  63.49K  --.-KB/s    in 0.002s

2020-04-17 18:50:40 (38.1 MB/s) - 'speedtest.py' saved [65018/65018]

root@server:~# chmod +x speedtest.py
root@servers:~# python speedtest.py
Retrieving speedtest.net configuration...
Testing from Nuclearfallout Enterprises (104.153.109.65)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Bel Air Internet LLC (Los Angeles, CA) [2.74 km]: 1.353 ms
Testing download speed................................................................................
Download: 584.65 Mbit/s
Testing upload speed......................................................................................................
Upload: 870.59 Mbit/s

Speedtest server provided by speedtest.net
and speedtest-cli from https://github.com/sivel/speedtest-cli

Please visit LinuxSpeedTest.com to find the ID of speedtest servers