If you’re using a hosted Linux server for web hosting or cloud services, you might be curious what kind of download/upload speeds your server has. Since many hosted servers are running headless you can’t simply go to www.speedtest.net and get your speed results that way. Fortunately, someone created a Python script called speedtest-cli that can be used from the Linux command line to run a simple test.
Simply download speedtest-cli to directory of your choice and run it:
1 2 3 |
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py chmod a+rx speedtest_cli.py ./speedtest_cli.py |
Without any parameters, the script will automatically find the best server and run a test:
You can also specify the –share parameter to generate a URL for sharing the results image:
You can see the rest of the parameters by running speedtest-cli -h:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
speedtest-cli -h usage: speedtest-cli [-h] [--bytes] [--share] [--simple] [--list] [--server SERVER] [--mini MINI] [--source SOURCE] [--timeout TIMEOUT] [--version] Command line interface for testing internet bandwidth using speedtest.net. -------------------------------------------------------------------------- https://github.com/sivel/speedtest-cli optional arguments: -h, --help show this help message and exit --bytes Display values in bytes instead of bits. Does not affect the image generated by --share --share Generate and provide a URL to the speedtest.net share results image --simple Suppress verbose output, only show basic information --list Display a list of speedtest.net servers sorted by distance --server SERVER Specify a server ID to test against --mini MINI URL of the Speedtest Mini server --source SOURCE Source IP address to bind to --timeout TIMEOUT HTTP timeout in seconds. Default 10 --version Show the version number and exit |