NEWS Earn Money with Onidel Cloud! Affiliate Program Details - Check it out

How to Benchmark Your Linux VPS in 2025: CPU, NVMe Disk, and Network Performance with sysbench, fio, iperf3, wrk/hey, and eBPF Tools

Performance benchmarking is crucial for understanding your VPS capabilities and ensuring optimal resource utilization. Whether you’re running a high-performance database, web application, or microservices architecture, knowing your system’s limits helps with capacity planning and performance tuning. This comprehensive guide walks you through benchmarking CPU, disk I/O, and network performance using industry-standard tools.

We’ll cover essential benchmarking tools like sysbench for CPU and database workloads, fio for storage testing, iperf3 for network throughput, and modern tools like wrk and hey for HTTP load testing, plus eBPF tools for advanced system observability.

Prerequisites

Before starting this tutorial, ensure you have:

  • Ubuntu 22.04 LTS or Ubuntu 24.04 LTS VPS with root access
  • Minimum 2 vCPU, 4GB RAM, 20GB NVMe storage
  • Stable internet connection for package installation
  • Basic Linux command-line knowledge
  • Another server or service for network testing (optional)

Warning: Benchmarking can be resource-intensive and may impact running services. Run tests during maintenance windows or on dedicated test systems.

Step 1: Install Benchmarking Tools

First, update your system and install the required benchmarking tools:

# Update system packages
sudo apt update && sudo apt upgrade -y

# Install essential benchmarking tools
sudo apt install -y sysbench fio iperf3 curl wget htop iotop

# Install wrk for HTTP load testing
sudo apt install -y build-essential libssl-dev git
git clone https://github.com/wg/wrk.git
cd wrk && make && sudo cp wrk /usr/local/bin/
cd .. && rm -rf wrk

# Install hey as an alternative HTTP load tester
wget https://hey-release.s3.us-east-2.amazonaws.com/hey_linux_amd64
chmod +x hey_linux_amd64
sudo mv hey_linux_amd64 /usr/local/bin/hey

Step 2: CPU Performance Benchmarking

Sysbench CPU Test

Test single-core and multi-core CPU performance using prime number calculations:

# Single-threaded CPU test
sysbench cpu --cpu-max-prime=20000 --time=30 run

# Multi-threaded CPU test (adjust threads based on your vCPU count)
sysbench cpu --cpu-max-prime=20000 --threads=$(nproc) --time=60 run

# Memory benchmark
sysbench memory --memory-total-size=10G --threads=$(nproc) run

The results show events per second – higher values indicate better CPU performance. Modern EPYC processors should deliver excellent performance in these tests.

Step 3: NVMe Disk Performance Benchmarking

FIO Storage Testing

Test various I/O patterns to understand your NVMe storage performance:

# Create test directory
mkdir -p /tmp/fio-test
cd /tmp/fio-test

# Random read test (4K blocks)
fio --name=random-read --ioengine=libaio --iodepth=32 --rw=randread \
    --bs=4k --direct=1 --size=1G --numjobs=4 --runtime=60 \
    --group_reporting --filename=test-file

# Random write test (4K blocks)
fio --name=random-write --ioengine=libaio --iodepth=32 --rw=randwrite \
    --bs=4k --direct=1 --size=1G --numjobs=4 --runtime=60 \
    --group_reporting --filename=test-file

# Sequential read test (1M blocks)
fio --name=seq-read --ioengine=libaio --iodepth=32 --rw=read \
    --bs=1M --direct=1 --size=2G --runtime=60 \
    --group_reporting --filename=test-file

# Sequential write test (1M blocks)
fio --name=seq-write --ioengine=libaio --iodepth=32 --rw=write \
    --bs=1M --direct=1 --size=2G --runtime=60 \
    --group_reporting --filename=test-file

# Mixed workload (70% read, 30% write)
fio --name=mixed-rw --ioengine=libaio --iodepth=32 --rw=randrw \
    --rwmixread=70 --bs=4k --direct=1 --size=1G --numjobs=4 \
    --runtime=60 --group_reporting --filename=test-file

Simple DD Test

# Write test
dd if=/dev/zero of=/tmp/test-write bs=1G count=1 oflag=direct

# Read test  
echo 3 | sudo tee /proc/sys/vm/drop_caches
dd if=/tmp/test-write of=/dev/null bs=1G count=1 iflag=direct

# Cleanup
rm /tmp/test-write

Step 4: Network Performance Benchmarking

iperf3 Network Throughput

Test network bandwidth and latency between servers:

# On server 1 (receiver)
iperf3 -s

# On server 2 (sender) - replace SERVER_IP with actual IP
iperf3 -c SERVER_IP -t 60 -i 5

# Test with multiple parallel streams
iperf3 -c SERVER_IP -t 60 -P 4

# UDP test with 1Gbps target
iperf3 -c SERVER_IP -u -b 1G -t 30

HTTP Load Testing

Benchmark web server performance using wrk and hey:

# Using wrk (replace with your web server URL)
wrk -t4 -c100 -d30s --latency http://your-server.com/

# Using hey for more detailed statistics
hey -n 10000 -c 50 -t 30 http://your-server.com/

# Test with custom headers
hey -n 1000 -c 10 -H "Accept: application/json" http://your-api.com/endpoint

Step 5: Advanced Monitoring with eBPF

Install bpftrace for advanced system observability during benchmarks:

# Install eBPF tools
sudo apt install -y bpftrace bpfcc-tools linux-headers-$(uname -r)

# Monitor disk I/O latency during fio tests
sudo bpftrace -e 'tracepoint:block:block_rq_complete { @[comm] = hist(args->nr_sector * 512); }'

# Track network packet drops
sudo bpftrace -e 'tracepoint:skb:kfree_skb { @[comm, stack] = count(); }'

# Monitor CPU scheduler delays
sudo bpftrace -e 'tracepoint:sched:sched_stat_sleep { @[comm] = hist(args->delay); }'

Step 6: Database Performance Testing

Test database performance with sysbench’s OLTP workload:

# Create test database
sudo apt install -y mysql-server
sudo mysql -e "CREATE DATABASE sbtest;"

# Prepare test data (adjust table-size based on your RAM)
sysbench oltp_read_write --table-size=100000 --mysql-db=sbtest \
    --mysql-user=root --mysql-password= prepare

# Run mixed read/write test
sysbench oltp_read_write --table-size=100000 --mysql-db=sbtest \
    --mysql-user=root --mysql-password= --time=300 \
    --threads=8 --report-interval=10 run

# Cleanup
sysbench oltp_read_write --mysql-db=sbtest --mysql-user=root cleanup

Best Practices

  • Baseline Testing: Run benchmarks on a fresh system before deploying applications
  • Multiple Runs: Execute tests 3-5 times and calculate averages for reliable results
  • Resource Monitoring: Use htop, iotop, and nethogs during tests
  • Realistic Workloads: Design tests that mirror your actual application patterns
  • Security: Never run benchmarks on production systems without proper planning
  • Documentation: Record system specifications, kernel version, and test conditions

Performance Tip: For CPU-intensive workloads, ensure your VPS has dedicated CPU resources rather than shared vCPUs to avoid performance variability.

Conclusion

Comprehensive benchmarking provides crucial insights into your VPS performance characteristics across CPU, storage, and network dimensions. The tools and methodologies covered in this guide – from traditional utilities like sysbench and fio to modern eBPF-based monitoring – give you a complete picture of system capabilities.

Regular performance testing helps identify bottlenecks, validate configurations, and ensure your infrastructure meets application demands. For consistently high performance across all benchmarks, consider exploring high-performance VPS solutions with EPYC processors and NVMe storage like those offered by cloud providers focused on performance optimization.

Understanding your system’s performance baseline is the first step toward building robust, scalable applications that deliver excellent user experiences.

Share your love