Performance & reliability

Why is my VPS slow?

Short answer

In order of likelihood: memory exhaustion causing swap thrashing, disk IO saturation, CPU steal time on shared cores, an unoptimised database, or network latency to your users. Check free -h and the st column in top first — between them they identify the cause about eighty per cent of the time.

Memory is the most common culprit and the least obvious. Once the working set exceeds RAM, the kernel swaps, and disk latency replaces memory latency — a factor of ten thousand. The symptom is a server that feels fine and then suddenly does not.

The second most common is disk. Run ioping or fio: NVMe should show sub-millisecond latency. If it does not, either you are on the wrong storage tier or a neighbour is saturating it.

  • free -h — if swap is in use and growing, that is the answer
  • top — the st column above 2–3% means steal time
  • iostat -x 1 — %util near 100 means disk saturation
  • Database slow query log — usually a missing index, not a small server
  • mtr to a user network — packet loss on a path is not a server problem

See also: CPU steal time · NVMe