In general, we have to purchase the VPS host must also do a little simple test performance, such as checking the basic configuration is not the time we buy the merchant label configuration, as well as network node ping speed, as well as the network node download file speed, The experience of these parameters is to a certain extent also determines the current purchase of VPS server stability and cost-effective.
In this article, the old left record Speedtest-cli tool script usage, can be used to detect the server directly download node file speed. SPEEDTEST-CLI, write a command script using Python to complete the speed test by calling the set up and down row node interface. Let's look at how to use it together.
First, SPEEDTEST-CLI tool address
The code is as follows |
Copy Code |
Address: HTTPS://GITHUB.COM/SIVEL/SPEEDTEST-CLI |
Second, SPEEDTEST-CLI tool installation
The installation of the SPEEDTEST-CLI tool needs to be performed in the Python 2.4 and above environments.
1, Pip Way to install
The code is as follows |
Copy Code |
Pip Install Speedtest-cli |
2, Easy_install installation method
The code is as follows |
Copy Code |
Easy_install SPEEDTEST-CLI |
3, GitHub installation
The code is as follows |
Copy Code |
git clone https://github.com/sivel/speedtest-cli.git Python speedtest-cli/setup.py Install |
4, download the source file installation
The code is as follows |
Copy Code |
Wget-o speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py chmod +x SPEEDTEST-CLI |
Third, the use of SPEEDTEST-CLI tools
Here we can see the SPEEDTEST-CLI tool commonly used parameter commands.
1, List
Displays a list of all node servers based on distance.
2. List all China node servers
Here we can see a lot of Chinese node server distance and line.
3, select the node test download speed
The code is as follows |
Copy Code |
./SPEEDTEST-CLI--server=5726 |
Choose a Chongqing node at random to see download speed. We can see the distance, the download rate.
Summary, we choose the VPS, the server for evaluation, all the hardware configuration, peripheral reference performance, can only be a reference, because we ultimately have to take into account the actual project open speed and user experience, this is the key.