Noisy Neighbors on a VPS
Level 2 · Plans and the shared machine
Why a busy customer on the same machine can slow your VPS. How to spot it as steal time with top, and what to do when it will not go away.
Course contentsLesson 3 of 7
Level 1 · Choosing the hosting
Level 2 · Plans and the shared machine
Level 3 · First boot and the way back in
Level 4 · The network around the server
After this lesson you can
- Explain how one machine's CPU is shared
- Read steal time in top
- Decide what to do about a noisy neighbor
10 mincovers 1 glossary entries
Worth reading first: VPS Plans and Billing
Why your VPS slows down when nothing changed
A noisy neighbor is another customer on the same machine who uses so much CPU that your server slows down. Your vCPUs are shares of real cores, and other slices share those cores too. When a neighbor is busy, your server may be ready to work and still have to wait. Linux counts that wait as steal time.
The machine's software hands out the real cores in tiny slices of time, far shorter than a blink. Most of the time there is enough to go round. The trouble starts when a host sells more vCPUs than the machine has cores, and many customers get busy at once.
You can see it with the top command. The CPU line ends with a number marked st. It is the share of time your server wanted the CPU but did not get it. 0.0 st means no waiting. 30.0 st means almost a third of your CPU time went to someone else.
A little steal now and then is normal on any shared machine. A steady 10 percent or more, while your own load has not changed, is a sign you have a noisy neighbor. Pages get slower, and jobs take longer, with nothing wrong inside your server.
You cannot see or stop the neighbor. What you can do is ask the host to move your server to another machine, which many will do. Some hosts sell plans with dedicated vCPUs, where the cores are yours alone, for a higher price.
Say the slowness is steady and costs you money. Then the real fix is a plan with cores of your own, or a dedicated server. Moving to a new machine helps only until the next busy neighbor arrives.
A common mistake is to buy a bigger plan to fix steal time. More shared vCPUs on the same busy machine wait just as long. Check st first. If it is high, move or pick dedicated cores. If it is low, the slowness is inside your own server.
$ top -bn1 | grep Cpu
%Cpu(s): 12.0 us, 3.0 sy, 0.0 ni, 60.0 id, 0.0 wa, 0.0 hi, 0.0 si, 25.0 stWorked example
Emma's slow evenings
Emma's shop loads in 0.4 seconds in the morning and 1.5 seconds every evening. Her own traffic barely changes.
top shows 2.0 st in the morning and 35.0 st at 8 p.m. She asks her host to move the server. On the new machine, st stays under 3 all evening, and pages load in 0.4 seconds again.
The words for this lesson1
Check yourself
top shows 30.0 st for hours. What does it mean?
Finished this lesson?
Marking it complete also marks its 1 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.