Test your server’s internet connection with speedtest in command line

We can clearly say that speedtest.net has the supremacy in internet speed tests, with thousands of speedtest servers accross the globe. And actually they give good bandwidth test results!

But you may not find their flash interface very sexy (my case) and if you have a server with no Graphical interface, you cannot use speedtest.net website.

Not a big deal, several scripts exists to let you run a speedtest in command line. It’s the case of Speedtest-cli.

Speedtest-cli, written in Python, is a simple yet complete script to let you perform internet bandwidth speed test on speedtest.net network.

You can also specify the server you want to use, or even to generate a speedtest.net share results image.

 

Installation

Of course, I suppose you already have python installed on your server (Require Python 2.4 and above) and the easiest way to install it will be with pip or easy_install. (pip is a more recent way to install and manage python packages, I recommend you to use this one)

1) Install python-pip (if not done yet)

In root (or with sudo) type:

apt-get install python-pip

2) Install the latest speedtest-cli with pip

pip install speedtest-cli

and….yes that’s all. You can now run speedtest-cli directly from your terminal.

 

Here are few examples on my 100M/100M@home connection:

– No option:

speedtest-cli  
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (59.115.216.36)...
Selecting best server based on ping...
Hosted by Chief Telecom (Taipei) [2.78 km]: 14.305 ms
Testing download speed........................................
Download: 92.44 Mbits/s
Testing upload speed..................................................
Upload: 91.58 Mbits/s

– With share results image

speedtest-cli --share
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (59.115.216.36)...
Selecting best server based on ping...
Hosted by kbro Co., Ltd. (Taipei) [2.78 km]: 11.603 ms
Testing download speed........................................
Download: 91.09 Mbits/s
Testing upload speed..................................................
Upload: 90.58 Mbits/s
Share results: http://www.speedtest.net/result/3583083252.png

speedtest cht taiwan 100m

– On targeted server only

Get first the list of servers

speedtest-cli --list
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
2181) kbro Co., Ltd. (Taipei, Taiwan) [2.78 km]
3967) Chief Telecom (Taipei, Taiwan) [2.78 km]
2327) Far Eastone Telecommunications Co., Ltd. (Taipei, Taiwan) [2.78 km]
2188) TFN Media Co., Ltd. (Taipei, Taiwan) [2.78 km]
2133) Taiwan Fixed Network (Taipei, Taiwan) [2.78 km]
4505) Chief Telecom (New Taipei, Taiwan) [10.50 km]
3921) Taiwan Fixed Network (Taoyuan, Taiwan) [31.51 km]
2589) Far EasTone Telecommunications Co., Ltd (Taoyuan, Taiwan) [31.51 km]
4938) Chief Telecom (Taoyuan, Taiwan) [31.51 km]
2187) TFN Media Co., Ltd. (Yilan, Taiwan) [47.14 km]

Then select the one you want to run the speedtest on (using its id, 4 digits)

speedtest-cli --server 2133
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (59.115.216.36)...
Hosted by Taiwan Fixed Network (Taipei) [2.78 km]: 15.02 ms
Testing download speed........................................
Download: 92.80 Mbits/s
Testing upload speed..................................................
Upload: 92.96 Mbits/s

I guess it’s time to see which one of us has the biggest….\0/

I don’t doubt you can do better 🙂

Gravatar

Loves to discover web-based apps to install on his own server@home and write articles about it

0 Comments:

Add a comment