VPS Benchmarking Guide: Test CPU, Disk, Network, and Database Performance Before You Deploy

VPS Benchmarking Guide: Test CPU, Disk, Network, and Database Performance Before You Deploy

Before deploying production workloads, benchmarking your VPS gives you concrete data on its actual capabilities — not just the specs on the pricing page. CPU single-thread performance matters for sequential code, disk I/O determines database performance, and network throughput affects everything from downloads to API response times. This guide runs the key benchmarks and helps you interpret what the numbers mean for your workload.

Quick Benchmark Script

<code"># Run all benchmarks in sequence and save results:
sudo apt install -y sysbench fio iperf3 bc
sudo pip3 install speedtest-cli --break-system-packages

# One-command benchmark suite:
bash <(curl -s https://raw.githubusercontent.com/masonr/yet-another-bench-script/master/yabs.sh)
# Runs: CPU, memory, disk, network (CDN download) benchmarks in ~5 minutes
# Outputs: complete benchmark report with comparison data

Step 1: CPU Benchmark

<code"># Single-thread CPU speed (most important for latency-sensitive code)
sysbench cpu --cpu-max-prime=20000 --threads=1 run
# events per second: higher = faster
# Typical results:
# Budget VPS (1 vCPU shared): 500–1,500 events/sec
# Mid-range VPS (2 vCPU dedicated): 2,000–5,000 events/sec
# High-end VPS (8 vCPU dedicated): 6,000+ events/sec

# Multi-thread CPU (for parallel workloads)
THREADS=$(nproc)
sysbench cpu --cpu-max-prime=20000 --threads=$THREADS run

# Alternative: openssl speed (measures crypto throughput)
openssl speed aes-256-cbc rsa2048 sha256

# Node.js / Python startup time (real-world latency proxy)
time node -e "console.log('started')"
time python3 -c "print('started')"

Step 2: Memory Benchmark

<code"># Memory bandwidth (important for in-memory databases, caching)
sysbench memory --memory-block-size=1K --memory-total-size=50G \
    --memory-access-mode=seq run

# Results interpretation:
# Sequential read/write: memory-block-size × operations/sec
# Typical VPS: 5,000–15,000 MB/sec sequential
# Low value: shared memory bus contention (noisy neighbor)

# Memory latency (important for database row access patterns)
sysbench memory --memory-block-size=1K --memory-total-size=50G \
    --memory-access-mode=rnd run

Step 3: Disk I/O Benchmark (Most Critical)

<code"># Install fio (flexible I/O tester)
sudo apt install -y fio

# 4K Random Read IOPS (database read performance — MOST IMPORTANT for web apps)
fio --name=rand-read --ioengine=libaio --iodepth=32 --rw=randread \
    --bs=4k --direct=1 --size=2G --numjobs=4 --runtime=60 \
    --filename=/tmp/fio-test --output-format=normal
# Look for: read: IOPS=XXXX
# NVMe SSD VPS: 30,000–200,000 IOPS
# SATA SSD VPS: 10,000–50,000 IOPS  
# HDD VPS:      100–200 IOPS (avoid for databases!)

# 4K Random Write IOPS (database write performance)
fio --name=rand-write --ioengine=libaio --iodepth=32 --rw=randwrite \
    --bs=4k --direct=1 --size=2G --numjobs=4 --runtime=60 \
    --filename=/tmp/fio-test

# Sequential Read (file serving, backup restore)
fio --name=seq-read --ioengine=libaio --iodepth=8 --rw=read \
    --bs=1m --direct=1 --size=2G --numjobs=1 --runtime=30 \
    --filename=/tmp/fio-test
# Expected: 500 MB/s+ for NVMe, 150–300 MB/s SATA SSD

# Quick disk test with dd (less accurate but instant):
# Write speed:
dd if=/dev/zero of=/tmp/disktest bs=1G count=1 oflag=direct
# Read speed (from OS cache if repeated):
dd if=/tmp/disktest of=/dev/null bs=1G count=1 iflag=direct

# Cleanup:
rm /tmp/fio-test /tmp/disktest

Step 4: Network Benchmark

<code"># Internal network speed (to another server in same datacenter)
# On server A:
iperf3 -s
# On server B:
iperf3 -c SERVER_A_IP -t 30

# Download speed from internet (affects user-facing performance)
speedtest-cli
# Or:
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3

# Download from well-known CDNs (cross-region latency test):
wget -O /dev/null https://speed.cloudflare.com/__down?bytes=100000000 2>&1 | tail -3

# Network latency (critical for database connections):
ping -c 20 8.8.8.8 | tail -2
# Look for: rtt min/avg/max/mdev = X/X/X/X ms
# Low latency: <5 ms within region # High latency: >50 ms — check VPS location

# TCP connection latency (simulates web request overhead):
curl -o /dev/null -s -w "Connect: %{time_connect}s\nTTFB: %{time_starttransfer}s\n" \
    https://yourdomain.com

Step 5: Database Benchmark

<code"># PostgreSQL benchmark with pgbench
sudo apt install -y postgresql-client

# Initialize test database
pgbench -h localhost -U postgres -i -s 10 benchmark_test
# -s 10 = 10x scale factor = ~1.5 million rows

# Read-heavy benchmark (typical web app pattern — 70% reads)
pgbench -h localhost -U postgres \
    -c 20 -j 4 -T 60 \
    -M prepared \
    benchmark_test
# c = 20 clients, j = 4 worker threads, T = 60 seconds
# Results: tps = transactions per second
# Budget VPS (HDD):   100–500 TPS
# Mid VPS (SSD):      1,000–5,000 TPS
# NVMe VPS:           5,000–20,000 TPS

# Write-heavy benchmark:
pgbench -h localhost -U postgres \
    -c 20 -j 4 -T 60 \
    -M prepared \
    --file=- << 'EOF'
UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
EOF

# Cleanup:
psql -h localhost -U postgres -c "DROP DATABASE benchmark_test;"

Step 6: Web Server Benchmark

<code"># Benchmark Nginx serving static files (your server's capacity):
sudo apt install -y wrk apache2-utils

# wrk (modern, multi-threaded):
wrk -t4 -c400 -d30s https://yourdomain.com/
# Results: Requests/sec, Latency avg/stdev/99th percentile

# Apache Bench (simpler):
ab -n 10000 -c 100 https://yourdomain.com/
# Results: Requests per second, Time per request

# For application benchmarks (Node.js, PHP-FPM, etc.):
wrk -t4 -c100 -d30s https://yourdomain.com/api/health

# Interpret Nginx + static file baseline:
# Any VPS should serve 5,000+ req/sec for static files
# PHP-FPM + WordPress: 50–500 req/sec (without caching)
# PHP-FPM + WordPress + Nginx microcache: 2,000+ req/sec

Benchmark Results Reference Table

Metric Poor Acceptable Good Excellent
CPU (sysbench) <500/s 500–2K/s 2K–5K/s >5K/s
Disk 4K rand IOPS <500 500–5K 5K–50K >50K
Network (local) <100 MB/s 100–500 MB/s 500 MB/s–1 GB/s >1 GB/s
PostgreSQL TPS <500 500–2K 2K–10K >10K

Getting Started

Run benchmarks on a fresh Ubuntu VPS at VPS.DO before deploying your applications — this establishes a performance baseline. Re-run after deploying your stack to measure overhead. The yabs.sh script produces comparable results to other VPS providers, making it easy to validate whether the provisioned hardware matches advertised specs.

Conclusion

VPS benchmarking reveals the actual performance you’ll experience rather than marketing specs. Disk I/O (random read/write IOPS) is the most critical metric for database-backed applications — the difference between NVMe (50,000+ IOPS) and HDD (200 IOPS) determines whether your application serves 10,000 or 100 database queries per second. CPU single-thread speed matters for your application’s request latency. Running these benchmarks before and after major deployments catches performance regressions early.

234 Comments

Post Your Comment

Fast • Reliable • Affordable VPS - DO It Now!

Get top VPS hosting with VPS.DO’s fast, low-cost plans. Try risk-free with our 7-day no-questions-asked refund and start today!