A fast, lightweight, and modern C++ command-line speed test client supporting both speedtest.net (raw TCP protocol) and Yandex Internetometer.
- Fast & Accurate: Uses raw TCP multi-threading to saturate bandwidth quickly.
- Auto Server Discovery: Selects the best server based on latency and distance.
- Interactive Server Picker: Choose servers interactively with filter support (
--select). - Yandex Internetometer Support: Alternative test mode (
--yandex) when Speedtest.net is blocked or throttled. - Result History: Saves test history to
~/.local/state/speedtest++/history.jsonlviewable via--historyor--last. - Multiple Output Formats: Supports
verbose(TUI/color),text(script-friendly), andjsonoutputs. - Shareable Results: Generates speedtest.net result image URLs (
--share).
sudo apt-get update
sudo apt-get install -y build-essential cmake libcurl4-openssl-dev libxml2-dev libssl-dev gitsudo dnf install -y gcc-c++ cmake libcurl-devel libxml2-devel openssl-devel gitsudo pacman -S --needed base-devel cmake curl libxml2 openssl gitsudo zypper install -y cmake gcc-c++ libcurl-devel libxml2-devel libopenssl-devel gitbrew install cmake pkg-config libxml2 openssl curl gitAlways use out-of-source CMake builds to keep the source tree clean:
git clone https://github.com/cherrywheel/speedtest.git
cd speedtest
# Configure and build in 'build' directory
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
# Install system-wide (optional)
sudo cmake --install buildIf you plan to copy the compiled binary to another server/VDS with different shared library versions (to avoid libxml2.so missing library errors):
cmake -B build -DENABLE_STATIC=ON -DCMAKE_BUILD_TYPE=Release
cmake --build buildThe resulting binary in ./build/SpeedTest will be statically linked against C++ runtimes and available static libraries, making it ready to run on target Linux machines.
# Build Docker image
docker build -t speedtest .
# Run speed test
docker run --rm -it speedtest# Run standard speed test (latency, download, upload)
./build/SpeedTest
# Test using Yandex Internetometer
./build/SpeedTest --yandex
# Interactively pick a server
./build/SpeedTest --select
# List 10 nearest servers by latency
./build/SpeedTest --list=10
# Filter servers by city/sponsor
./build/SpeedTest --city "Frankfurt"
# Perform download test only
./build/SpeedTest --download
# Output result in JSON format
./build/SpeedTest --output json
# View previous test history
./build/SpeedTest --last
./build/SpeedTest --history=20| Option | Description |
|---|---|
--help |
Show help message and exit |
--latency |
Perform latency test only |
--quality |
Perform quality test (includes latency) |
--download |
Perform download test only |
--upload |
Perform upload test only |
--share |
Generate result image URL on speedtest.net |
--select |
Interactively select server from list |
--no-select |
Automatically pick lowest-ping server |
--list[=N] |
List N nearest servers with ping and exit |
--city NAME |
Filter servers matching city/sponsor/host |
--yandex |
Run test against Yandex Internetometer |
--last |
Show most recent test result without running test |
--history[=N] |
Show last N saved test results |
--output TYPE |
Set output format (verbose, text, json) |
--insecure |
Disable SSL certificate verification |
1. Error: libxml2.so.16: cannot open shared object file
Cause: The binary was built on one Linux distribution and copied to another machine with a different libxml2 shared library version.
Fix: Build directly on the target machine, or build with static linking (cmake -B build -DENABLE_STATIC=ON).
2. Error: The current CMakeCache.txt directory ... is different than ...
Cause: An old CMakeCache.txt was created directly in the project root directory.
Fix: Clean out-of-source builds avoid this issue. Run rm -rf CMakeCache.txt CMakeFiles build and build using cmake -B build.
- Reworked from https://github.com/taganaka/SpeedTest.git
- Used repos:
- For Internetometer: https://github.com/Master290/internetometer-cli
SpeedTest++ is released under the MIT License.
Make usable binary file