In Windows, we can easily access speedtest.net through a browser for speed testing. in a Linux system without a graphical management interface, we can also use a small script speedtest-cli for speed testing. The small scripts used in this article have passed the test in CentOS6, Debian7, Ubuntu12.04/14.04, because these releases contain Pyth by default.
In Windows, we can easily access speedtest.net through a browser for speed testing. in a Linux system without a graphical management interface, we can also use a small script speedtest-cli for speed testing.
The small scripts used in this article have passed the test in CentOS 6, Debian 7, Ubuntu 12.04/14.04, because these releases all contain Python. * by default.
1. download the script and grant permissions
wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.pychmod +x speedtest-cli
Or
curl -o speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.pychmod +x speedtest-cli
II. running method
The default speed measurement method only needs to run one command:
./speedtest-cli
The result is as follows:
root@example:~# ./speedtest-cliRetrieving speedtest.net configuration...Retrieving speedtest.net server list...Testing from Earth (192.0.0.2)...Hosted by Earth (Unknown) [100.00 km]: 100.00 msTesting download speed........................................Download: 100.00 Mbits/sTesting upload speed..................................................Upload: 100.00 Mbits/s
However, sometimes the geographic location of the speedserver is determined by the IP address of the server. we can do this by specifying the server ID. first, open this page:
http://www.speedtest.net/speedtest-servers-static.php
Then you can useCtrl + F
Search for the physical location of your server. for example, if you want to speed up a server in Hong Kong, findHong Kong
Node:
We can see that the ID is 5120, so in your server, as long as you run
./speedtest-cli --server 5120
You can specify a server for speed measurement.
Sometimes your server may accesshttp://www.speedtest.net/speedtest-servers-static.php
The 403 Forbdden error occurs. this is because the network on your server is blocked by speedtest.net. you can simply create an Nginx Reverse proxy and modify it.speedtest-cli
File.