Why Benchmark Your VPS?
VPS providers advertise specs like “4 vCPUs, 8 GB RAM, SSD storage,” but real-world performance depends on hypervisor configuration, neighbor activity, and storage architecture. A $10/mo VPS from one provider might outperform a $30/mo plan from another. Benchmarking gives you objective data to compare plans, verify you’re getting advertised performance, and identify bottlenecks before they cause production outages.
This guide covers a complete benchmarking methodology for any Linux VPS: CPU stress testing, memory bandwidth measurement, disk I/O profiling, and network throughput validation.
Prerequisites
- A Linux VPS with root access
- Benchmarking tools installed:
apt update && apt install -y sysbench fio iperf3 stress-ng htop - A second machine or public iperf3 server (e.g.,
iperf.he.net) for network tests
1. CPU Benchmarking: sysbench
sysbench measures how many prime numbers your CPU can calculate per second — a good proxy for general computational ability.
Single-Thread Test
sysbench cpu --threads=1 --cpu-max-prime=20000 run
Multi-Thread Test
sysbench cpu --threads=$(nproc) --cpu-max-prime=20000 run
Interpreting results: Divide multi-thread events by single-thread events to see scaling efficiency. Ideal scaling is n-threads × single-thread events. If a 4-core VPS delivers only 2.5x improvement, the provider may be limiting CPU time or sharing cores. Typical values on modern EPYC cores: 4500-6500 events/sec per thread.
2. Memory Benchmarking
Memory benchmarks measure bandwidth between CPU caches, RAM, and swap. Low memory bandwidth slows PHP execution, database queries, and large file processing.
# Sequential memory write
sysbench memory --memory-block-size=1M --memory-total-size=50G --memory-oper=write run
# Sequential memory read
sysbench memory --memory-block-size=1M --memory-total-size=50G --memory-oper=read run
Expected ranges for VPS instances:
| Memory Type | Read Speed (MiB/s) | Write Speed (MiB/s) |
|---|---|---|
| DDR3 (older hosts) | 3,000-6,000 | 2,500-5,000 |
| DDR4 (most providers) | 8,000-14,000 | 6,000-11,000 |
| DDR5 (premium providers) | 15,000-25,000 | 12,000-20,000 |
If your VPS delivers under 3,000 MiB/s, the host CPU may be older or the memory channel is congested by neighbor VMs.
Sequential Performance
# Sequential read 1M blocks
fio --name=seqread --rw=read --size=4G --bs=1M --direct=1 --runtime=30 --output-format=json
# Sequential write 1M blocks
fio --name=seqwrite --rw=write --size=4G --bs=1M --direct=1 --runtime=30 --output-format=json
Random IOPS Test
# 70% read / 30% write mix (typical database pattern)
fio --name=dbmix --rw=randrw --rwmixread=70 --size=4G --bs=4k --direct=1 --numjobs=4 --runtime=60 --output-format=json
Key output fields:
read iopsandwrite iops: Random IOPS — critical for databasesread bwandwrite bw: Bandwidth in KB/slatency mean: Average I/O latency in microseconds
For NVMe-backed VPS plans, expect 50,000+ read IOPS and sub-200 µs latency. For SATA SSD-backed plans, 5,000-15,000 IOPS is normal. If you paid for SSD storage and get under 2,000 IOPS, the provider is overselling.
4. Network Performance Testing
Network tests measure real-world throughput between your VPS and the internet, accounting for provider uplink limits and peering quality.
# Download test from public iperf server
iperf3 -c iperf.he.net -t 30 -P 4
# Upload test (requires a remote iperf3 server)
iperf3 -c your-test-server-ip -t 30 -P 4 -R
Compare against provider advertised port speed. A 1 Gbps port delivering 900 Mbps is healthy; 200 Mbps suggests traffic shaping or congested uplinks.
5. Stability Stress Testing
Short benchmarks can miss thermal throttling or CPU credit exhaustion. Run extended stress tests to verify sustained performance:
# 10-minute CPU + memory stress
stress-ng --cpu $(nproc) --vm 2 --vm-bytes 75% --timeout 600s --metrics-brief
# Monitor CPU frequency and throttling during the test
watch -n 2 "grep 'cpu MHz' /proc/cpuinfo"
If CPU frequency drops significantly after 2-3 minutes, the provider uses burstable CPU plans that throttle sustained workloads.
6. Creating a Benchmark Report
Save results in a consistent format for future comparison:
#!/bin/bash
# save-benchmark.sh - Save all results with timestamp
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p ~/benchmarks/$DATE
sysbench cpu --threads=$(nproc) run > ~/benchmarks/$DATE/cpu.txt
sysbench memory --memory-total-size=50G run > ~/benchmarks/$DATE/memory.txt
fio --name=bench --rw=randrw --rwmixread=70 --size=2G --bs=4k --direct=1 --numjobs=4 --runtime=30 > ~/benchmarks/$DATE/disk.txt
iperf3 -c iperf.he.net -t 30 -P 4 > ~/benchmarks/$DATE/network.txt
echo "Benchmarks saved to ~/benchmarks/$DATE/"
Re-run this script after any provider migration, plan upgrade, or performance degradation to quantify changes.
Common Benchmarking Mistakes
- Running benchmarks during peak hours: Neighbor activity inflates variance. Run at consistent times.
- Using default block sizes for disk tests: 64K blocks inflate IOPS. Use 4K for realistic random I/O.
- Not warming up the disk: First-run against an empty disk cache gives inflated results. Run once to warm, then record.
- Single-run samples: Run each test 3 times and take the median for reliable data.
Conclusion
A systematic benchmarking approach — CPU, memory, disk, network, and stability — gives you the data you need to evaluate VPS providers objectively. Use sysbench for CPU and memory, fio for disk I/O, iperf3 for network bandwidth, and stress-ng for sustained load testing. Document your results and re-benchmark periodically to catch provider-side degradation early. Good benchmarks are the foundation of informed hosting decisions.
To compare VPS providers by their benchmark performance, see our VPS comparison table. Vultr ($2.50/mo starting) and Hetzner ($4/mo starting) offer competitive performance-to-price ratios for benchmark-conscious users.


Leave a Reply
You must be logged in to post a comment.