Performance & reliability

How do I benchmark a VPS?

Short answer

Measure the three things that actually vary: single-thread CPU with sysbench, disk with fio at 4K random read/write, and network with iperf3 to a known endpoint. Run each several times across different hours — a single benchmark measures that minute, not the server.

Disk is where providers differ most and where synthetic marketing numbers are least useful. Test 4K random IOPS with a queue depth of 1, which is what a database actually does, rather than sequential throughput, which looks impressive and predicts nothing.

Watch steal time throughout the run. A benchmark that looks good at 03:00 and poor at 20:00 is telling you about your neighbours rather than about the hardware.

  • sysbench cpu --cpu-max-prime=20000 run — single-thread performance
  • fio --name=rand --rw=randrw --bs=4k --iodepth=1 --size=1G --runtime=60
  • iperf3 -c a-known-endpoint — real throughput, not the advertised port speed
  • vmstat 1 during all of it — watch the st column

See also: IOPS