When looking for a VPS (virtual private server) provider, many list the specs and features publicly but often neglect to share the network speed. That’s probably fair since it’s really difficult to give an accurate “speed” when servers are often located all over the world and so are your users.
It might be helpful to test out the network speed to some of the locations you’ll expect users to connect from. And, thanks to GitHub user @Sivel we can use their python-based CLI for the popular website speedtest.net – speedtest-cli.
Install speedtest-cli
If Python is installed…
You can install the speedtest-cli via pip
Otherwise…
Of course, all of the instructions are provided in the documentation on GitHub where you can find the additional usage flags.
To run a basic speed test you can simply run:
You can watch an example of installing and running these commands below. This is running on a VPS provided by Vultr.
After the speedtest-cli has completed you’ll receive output similar to the following, containing the server you have connected to and your download and most-importantly, upload speed.
One trick that may make this tool more useful for your real-world testing may be to provide the —server argument where you can supply a known SpeedTest.net server ID to test against. this may be useful if you know a large portion of your users will be connecting from known locations or if you want to deliberately test against multiple nodes.
And finally, if you are truly passionate about testing you may also export to a CSV file using —csv so you can capture your findings.