In many cases, we need to test the uplink and downlink bandwidths of Linux servers. Speedtest.net may be one of the most widely used websites that can be used to test the bandwidth speed ;. Speedtest.net provides a command line version & mdash; speedtest-cli. The following shows how to use speedtest-cli in Linux command line to test the bandwidth connection speed. I,
In many cases, we need to test the uplink and downlink bandwidths of Linux servers. Speedtest.net may be one of the most widely used websites ".
Speedtest.net provides a command line version-speedtest-cli. The following shows how to use speedtest-cli in Linux command line to test the bandwidth connection speed.
1. install speedtest-cli
Speedtest-cli is a lightweight Linux command line tool written in Python. it can be run from Python 3.4 to Python. It is based on the infrastructure of Speedtest.net to measure the uplink/downlink speed of the network. Installing speedtest-cli is simple-you only need to download its Python script file.
[Root @ localhost temp] # wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
[Root @ localhost temp] # chmod a + rx speedtest_cli.py
[Root @ localhost temp] # mv speedtest_cli.py/usr/local/bin/speedtest-cli
[Root @ localhost temp] # chown root: root/usr/local/bin/speedtest-cli
You can also download speedtest_cli.py from your computer and upload it to the server.
II. use speedtest-cli to test the network speed
Using the speedtest-cli command is also simple, and it can work without any parameters.
[Root @ localhost temp] # speedtest-cli
After you enter this command, it will automatically find the nearest Speedtest.net server (geographic distance), and then print the network/downlink rate of the test.
[Root @ localhost temp] # speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from China Telecom (219.135.214.145 )...
Selecting best server based on latency...
Hosted by CTM Internet Services (Macau) [106.48 km]: 55.974 MS
Testing download speed ........................................
Download: 3.15 Mbit/s
Testing upload speed ..................................................
Upload: 0.58 Mbit/s
Test result description: the behavior is 0.58 Mbit/s and 3.15 Mbit/s.
Of course, the test results may not always be able to meet this value in actual applications. it can only be used as a reference.