There’s a ritual every VPS owner knows. New server comes online, and before anything else, you paste in a one-liner from a forum post — bench.sh, vpsbench, one of their many mutations — and pipe a shell script you’ve never read straight into bash to find out whether your new host oversold you. The results are useful. The tradition of blindly executing anonymous shell scripts as root is… less great. And those scripts, passed around and patched for over a decade, have become tangles of copied fragments with dead download nodes and inconsistent output.
bench.py is my consolidation of that whole lineage into a single, readable Python script. Same job — system info, CPU benchmark, disk I/O, download speeds from nodes around the world — but in one file you can actually audit before you run, with a modern terminal UI. Like the other projects I’ve been writing up, it’s MIT-licensed and free on GitHub:
What It Measures
Run python3 bench.py and you get the full picture of a machine in a few minutes.
The system information section reports CPU model, cores, frequency, and cache, plus memory, swap, disk, OS, kernel, and architecture — and it detects virtualization, distinguishing Docker, LXC, KVM, VMware, VirtualBox, Xen, Hyper-V, OpenVZ, Parallels, and honest bare metal. That last one matters when a “dedicated” server turns out to be a slice of something. It also reports your TCP congestion control algorithm (nice for confirming BBR is actually active) and resolves your public IP with organization and location via ipinfo.io.
The CPU benchmark keeps the classic vpsbench approach: generate a 25 MB random file, time how long bzip2 takes to crush it. Simple, comparable, and there are a decade of historical numbers out there to measure against.
Disk I/O uses dd for sequential writes, averaged across multiple runs — three by default, with block size, count, and run count all adjustable from the command line.
Download tests hit nodes across the US East, Central, and West, Europe, and Asia-Pacific — CacheFly, Linode, Vultr, and OVH locations — so you see not just raw speed but how your server’s connectivity varies by region. Results render with color-coded speed bars in the terminal, courtesy of the excellent rich library, which is the script’s only dependency.
Built for Real-World Runs
The flags are where daily-driver convenience shows up. --skip-download for airgapped or metered boxes, --skip-io when you don’t want to hammer an SSD, --skip-cpu and --skip-geo for quick partial runs, and --output results.txt to save a plain-text copy — handy for keeping a benchmark file with each server the way I keep provenance notes with a record. Testing a new host? Run it on day one, save the output, and you’ve got a baseline to compare against when performance feels off eight months later.
Credit Where It’s Due
This tool exists because of the shell scripts that came before it, and the README credits them in detail: Teddysun and LookBack’s autospeed lineage contributed the system info collection, virtualization detection, and I/O approach; Mario Gutierrez’s vpsbench contributed the bzip2 CPU test and the quick-bench structure; and the various bench2.sh descendants contributed the download table format and node lists. Consolidating them into Python wasn’t about replacing that work — it was about giving it a single maintainable home with consistent output.
Requirements and Usage
Python 3.6+ and one pip install rich. Then:
# Full benchmark
python3 bench.py
# Skip geolocation, run 5 I/O passes
python3 bench.py --skip-geo --io-runs 5
# Save results to a file
python3 bench.py --output results.txt
That’s the whole setup. And because it’s one Python file, the answer to “what does this thing actually do to my server?” is: open it and read it — which is more than the curl-pipe-bash tradition ever offered.
Grab it from the GitHub repository. If you’ve got benchmark numbers from an interesting box — ancient hardware especially welcome — share them in the comments.
