How to use SPEEDTEST-CLI to test network speed in Linux

Source: Internet
Author: User
Tags chmod

Windows we can very convenient direct browser access to Speedtest.net for speed testing, in the absence of a graphical management interface of the Linux system, we can also use a small script speedtest-cli to speed.

The small scripts used in this article are tested under CentOS 6, Debian 7, and Ubuntu 12.04/14.04 because these distributions contain the Python 2.7.* that are often easy to use.

First, download the script and give permission

Wget-o speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod +x SPEEDTEST-CLI

Or

Curl-o speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod +x SPEEDTEST-CLI

Second, the Operation method

The default speed method is to run only one command:

./speedtest-cli

The results appear as follows:

root@example:~#./speedtest-cli
Retrieving Speedtest.net configuration ...
Retrieving Speedtest.net server list ...
Testing from the Earth (192.0.0.2) ...
Hosted by Earth (Unknown) [100.00 km]: 100.00 ms
Testing download speed ....... ...... ..... ..... ..... ..... ...... ...
download:100.00 mbits/s
Testing upload speed ....... ...... ...... ..... ..... ..... ..... ..... ..... ..... ...
upload:100.00 mbits/s

But sometimes the server's IP to judge the location of the speed server is not accurate, we can specify the server ID way to do, first of all, open this page:

http://www.speedtest.net/speedtest-servers-static.php

You can then use Ctrl + F to search for the physical location of the server you want, for example, I want to speed up the Hong Kong server, and find a HK Kong node:

<server url= "http://speedtestneta.hkix.net/speedtest/upload.php" lat= "22.3000" lon= "114.2000" Name= "The Kong" country= "cc=" "HK" sponsor= "HKIX1" id= "5120" url2= "http://speedtestnetb.hkix.net/speedtest/upload.php" host= " speedtestneta.hkix.net:8080 "/>
We can see the ID is 5120, then in your server, just run

./SPEEDTEST-CLI--server 5120

You can specify the server for Speed measurement

Sometimes your server access http://www.speedtest.net/speedtest-servers-static.php will 403 Forbdden error, because your server's network is blocked by Speedtest.net, You simply do a Nginx and then modify the Speedtest-cli file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.