How to Benchmark Your VPS: CPU, Disk I/O, Network, and Latency Tests with Real Commands

Benchmarking your VPS immediately after provisioning is the only way to verify that you are getting the performance you paid for. This guide provides ready-to-run commands for testing CPU performance, disk I/O throughput, network speed, and latency — with explanations of what each result means for your application.

Before diving in, use our VPS provider comparison table to see how different hosts stack up on performance specifications.

1. CPU Benchmarking

Two vCPUs from one provider can deliver 2-3x the performance of two vCPUs from another, depending on the CPU generation and whether the cores are pinned or shared. Run these tests to measure your actual CPU power.

Using sysbench

sysbench is a lightweight benchmarking tool available in most package managers. It calculates prime numbers to measure CPU computational throughput.

# Install sysbench
sudo apt install sysbench -y

# Single-core performance test
sysbench cpu run --threads=1 --cpu-max-prime=20000

# Multi-core (all available cores)
sysbench cpu run --threads=$(nproc) --cpu-max-prime=20000

Interpreting results: The “events per second” metric is the number of prime calculations completed. Compare this across providers — a difference of 30% or more indicates a significant CPU generation gap. A modern AMD EPYC 9654 (Genoa) core should score roughly 2x higher than an older Intel Xeon E5-2690 v2 core.

Using openssl Speed Test

openssl provides a quick CPU benchmark without installing extra packages:

# Multi-core AES encryption benchmark
openssl speed -elapsed -multi $(nproc) aes-256-cbc

This is particularly relevant for VPS instances used for TLS termination (web servers, VPNs) where AES-NI hardware acceleration makes a significant difference.

2. Disk I/O Benchmarking

Storage performance is the most common bottleneck in VPS hosting. A provider advertising “SSD storage” may be using SATA SSDs (500 MB/s) or NVMe (3,500+ MB/s). Always test with fio.

Sequential Read/Write

Sequential benchmarks measure throughput for large file operations — useful for file servers, backups, and media streaming.

# Install fio
sudo apt install fio -y

# Sequential read (1M block size)
fio --name=seq-read --rw=read --bs=1M --size=1G --runtime=30 --direct=1

# Sequential write
fio --name=seq-write --rw=write --bs=1M --size=1G --runtime=30 --direct=1

Random 4K IOPS (Database Workload)

Random 4K reads simulate database lookups (MySQL, PostgreSQL). This is the most important VPS benchmark for transactional workloads.

# Random read IOPS (4K block, 32 depth)
fio --name=rand-read --rw=randread --bs=4k --size=1G --runtime=60 --iodepth=32 --direct=1

# Random write IOPS
fio --name=rand-write --rw=randwrite --bs=4k --size=1G --runtime=60 --iodepth=32 --direct=1

Targets: NVMe storage should achieve 300,000+ IOPS for 4K random reads. SATA SSDs typically deliver 50,000-90,000 IOPS. If you see fewer than 10,000 IOPS, you may be on shared HDD storage.

3. Network Speed Benchmarking

Network throughput on a VPS is limited by the virtual port speed, the provider’s upstream bandwidth, and the quality of the hypervisor’s virtual NIC driver.

Using iperf3

iperf3 measures TCP and UDP throughput between two endpoints. You need a test server on the other end — many public iperf3 servers are available.

# Install iperf3
sudo apt install iperf3 -y

# Test against a public iperf3 server (NYC)
iperf3 -c iperf.he.net -t 30

# Reverse mode (download test)
iperf3 -c iperf.he.net -t 30 -R

Quick Download Test

If you don’t have access to an iperf3 server, use a direct download speed test:

# Download a 100MB test file and measure throughput
curl -o /dev/null -s -w "Speed: %{speed_download} bytes/sec
" https://speedtest-nyc1.digitalocean.com/100mb.test

4. Latency and Network Quality Testing

Latency affects application responsiveness, especially for database queries, API calls, and real-time services.

Ping and MTR

# Measure round-trip time to a target
ping -c 10 google.com

# Combined traceroute and ping (install mtr)
sudo apt install mtr -y
mtr -r -c 10 google.com

TCP Latency with hping3

# Measure TCP handshake latency
sudo apt install hping3 -y
sudo hping3 -S -p 80 -c 10 google.com

Interpreting results: Under 10 ms is excellent (same region). 10-40 ms is good (same continent). Above 100 ms indicates significant geographical distance and may require a CDN or closer server location.

5. Putting It All Together: A Benchmark Script

Save the following as benchmark.sh to run all tests in sequence:

#!/bin/bash
echo "=== CPU Benchmark ==="
sysbench cpu run --threads=$(nproc) --cpu-max-prime=20000 | grep "events per second"

echo "=== Disk Sequential Read ==="
fio --name=seq-read --rw=read --bs=1M --size=1G --runtime=15 --direct=1 --output-format=json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(f"{d['jobs'][0]['read']['bw']/1024:.0f} MB/s")"

echo "=== Disk Random 4K Read IOPS ==="
fio --name=rand-read --rw=randread --bs=4k --size=1G --runtime=15 --iodepth=32 --direct=1 --output-format=json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(f"{d['jobs'][0]['read']['iops']:.0f} IOPS")"

echo "=== Network Download Speed ==="
curl -o /dev/null -s -w "%{speed_download} bytes/sec
" https://speedtest-nyc1.digitalocean.com/100mb.test

echo "=== Latency ==="
ping -c 5 google.com | tail -1

Conclusion

Regular benchmarking helps you detect performance degradation over time and verify that your provider is delivering the hardware you are paying for. Run the full suite of tests immediately after provisioning, and re-run monthly to catch noisy-neighbor issues or hardware degradation. Use the VPS provider comparison table to find hosts that consistently deliver on their performance promises.

Leave a Reply