How to Benchmark Your VPS: CPU, Disk, and Network Tests

A VPS plan lists a number of virtual CPUs, some RAM, and a disk size. Those numbers say almost nothing about how fast the machine actually runs. Two plans with identical specs can behave very differently, because the host hardware, the neighbors on the same node, and the storage backend all shape real performance. That is why you should benchmark your VPS before you move a production site onto it, and again whenever performance changes for no clear reason.

This guide covers the three tests that matter most: CPU, disk, and network. The vps benchmarking tools used here are all free and ship with most distributions. You will run each test, learn what the output means, and learn how to read the three results together instead of treating each number on its own.

Before You Run Any Test

A benchmark only means something if you can repeat it. Run tests on an idle server, or as close to idle as you can get. A backup job, a cron task, or a traffic spike during the test will pollute the numbers, and you will spend hours chasing a problem that was only a busy neighbor process.

Record the basics before you start: the plan size, the operating system version, the kernel version, and the time of day. Run each test at least twice, and keep the slower result in mind as well as the faster one. A VPS that is fast at 3 a.m. and slow at 8 p.m. has a noisy-neighbor problem, and one good run will not tell you that.

One more caution: CPU stress tests and disk write tests put real load on the machine. Never run them on a production server during busy hours. If you must test a live box, use short runs and watch the load while the test runs.

CPU Tests: Speed and Steadiness

Start with a simple picture of the CPU. The command lscpu shows the model, the core count, and the clock speed the host reports. That is the label, not the performance. For performance, use sysbench or stress-ng, both available in most distribution repositories.

A typical sysbench CPU run looks like this:

sysbench cpu --cpu-max-prime=20000 --threads=4 run

The output reports events per second and total time. Run it with one thread first, then with as many threads as you have virtual CPUs. The single-thread result tells you how fast one request handler runs. The multi-thread result tells you how the machine scales when several requests arrive at once. If multi-thread scaling stalls far below the core count, the host may be oversubscribed, or the virtual CPUs may share physical cores.

Steadiness matters as much as peak speed. Run the same test for several minutes rather than a few seconds. Some hosts allow a short burst at full speed and then throttle the virtual CPU back. A test that only lasts ten seconds will never show that throttle, and your site will feel fine in testing and slow under a long traffic peak. If you already track your server day to day, pair these one-off tests with ongoing checks; our guide to Linux server monitoring basics covers the metrics worth watching between benchmarks.

Disk Tests: Throughput and Latency

Disk speed decides how fast your database answers, how quickly pages build, and how long backups take. A good disk speed test covers both throughput and latency, not just one of them. Two numbers matter: throughput, measured in megabytes per second, and latency, measured in milliseconds per operation. A disk can move large files quickly and still feel slow if every small read takes a long time.

The standard tool is fio. A simple sequential write test looks like this:

fio --name=test --ioengine=libaio --rw=write --bs=1M --size=1G --numjobs=1 --runtime=60 --time_based

Then test random small reads and writes, which resemble database work far more closely than one big sequential file:

fio --name=test --ioengine=libaio --rw=randrw --bs=4k --size=1G --numjobs=4 --runtime=60 --time_based

Pay attention to IOPS (operations per second) on the random test, not just the megabytes per second. A web server and a database issue thousands of small reads and writes. High sequential throughput with weak random IOPS means slow queries and slow page builds despite an impressive headline number.

Two warnings apply here. First, write tests wear flash storage, so do not run multi-gigabyte write tests on a production disk for fun. Second, test on the same filesystem your application uses. A test on a temporary disk or a different mount can report numbers your database will never see. If you want a fuller picture of how storage choices affect a live site, see our comparison of Nginx concurrent connection tuning, which shows how disk and connection limits interact under load.

Network Tests: Bandwidth, Latency, and Loss

Network tests split into three questions: how much data can move, how quickly a packet gets there, and how many packets never arrive.

For bandwidth, iperf3 measures throughput between two machines you control. Run it against a server in the same region your visitors come from, not against a random public endpoint. A test to a distant continent measures the internet path, not your VPS. For latency and loss, a network latency test with mtr combines ping and traceroute and shows where packets slow down or drop along the route. Run it for at least a few minutes. A single ping hides packet loss that only shows up over time.

Also test what your visitors actually experience. A download test from your server to a test file, or a timed request to your own site from an outside machine, tells you more than a raw bandwidth number. If your audience sits in one region, test from that region. A VPS that is fast to its own data center and slow to your users is the wrong VPS for your site. When you compare providers, benchmarks belong next to the other factors in our guide to the best unmanaged VPS providers for performance, since price and support matter once raw speed is roughly equal.

Reading the Three Results Together

The value of a benchmark comes from combining the three tests. Slow pages with fast CPU and disk numbers point at the network or the application stack. Slow queries with fast CPU numbers point at disk latency. High CPU use during a disk test points at a storage driver or a host problem, not at your code.

Write the results down in one place: CPU single-thread and multi-thread events per second, disk sequential throughput and random IOPS, network bandwidth, latency, and loss. Repeat the same tests after any change, whether that is a plan upgrade, a provider move, or a kernel update. If a number drops sharply after a change, you have a before-and-after record instead of a vague feeling that the server got slower.

Finally, benchmark before you migrate, not after. A baseline from the old server makes the new server’s numbers meaningful, and it gives you a clear go or no-go decision instead of a migration you later regret. Our walkthrough of how to migrate VPS providers with zero downtime shows how to move once the numbers say the new machine is actually better.

Benchmark Your VPS: Final Checklist

  • Record plan, OS, kernel, and time of day before testing
  • Run CPU tests single-threaded and multi-threaded, for minutes not seconds
  • Test disk with sequential and random workloads, and watch IOPS
  • Test network bandwidth, latency, and loss to your visitors’ region
  • Repeat each test, keep both runs, and retest after every major change

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.