package playne

imports "programmer"

Why is my Quad Core VPS Running Slowly?

Or how a host schedules CPU cycles.

So I learnt an interesting tidbit of information the other day to do with a VPS and why it had high load and bugger all CPU usage. If you see something similar to this in top:

top - 20:30:53 up 8 days,  6:42,  1 user,  load average: 9.37, 10.81, 9.67
Tasks: 135 total,  12 running, 133 sleeping,   0 stopped,   0 zombie
Cpu(s): 30.8%us,  0.8%sy,  0.0%ni, 67.8%id,  0.5%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3790268k total,  3621780k used,   168488k free,   350528k buffers
Swap:  1830908k total,    11464k used,  1819444k free,  2753548k cached

over a long period of time, and you have more than 2 CPUs in your VPS – consider dropping back to 2 vCPU’s.

But Why? Surely 4 CPUs is Better than 2!

They certainly are, but when the underlying host gets busy, slots for 2 vCPU hosts get scheduled a lot more often than slots for quad vCPU’s – this is all down to the scheduler.