Fix VM High CPU Contention in 3 Steps
Your VM is fighting for CPU time with other VMs on the same host. Here's how to find which VM is hogging the CPU and fix it fast.
1. Host Is Overloaded – Too Many VMs Sharing the Same CPU
This is the #1 reason for high CPU contention. Your host has 16 logical cores, but you're running 20 VMs on it. That's like 20 people trying to use 16 bathroom stalls at once. Someone waits.
You'll see this most often during peak hours – 9 AM to 11 AM on weekdays. Users start their day, VMs all wake up, and your host CPU hits 90% or more.
How to confirm it's an overloaded host
- Open your hypervisor management tool. For VMware, that's vCenter. For Hyper-V, it's Hyper-V Manager or Failover Cluster Manager.
- Look at the host's CPU usage. If it's consistently above 80% for more than 10 minutes, the host is overloaded.
- Check CPU Ready time (VMware) or CPU Wait time (Hyper-V).
For VMware: In vCenter, select the host, go to the Monitor tab, then Performance. Add the metric called "CPU Ready" (sometimes listed as %RDY). If you see values over 5%, you have CPU contention. Over 10% is bad. Over 20% – your VM is barely running.
For Hyper-V: Open Performance Monitor on the host. Add the counter \Hyper-V Hypervisor Virtual Processor\% Total Run Time for each VM. If it's consistently under 80% for a VM that you know is busy, the VM is waiting on CPU.
Fix it: Move VMs or add CPU cores
- Move some VMs to another host. Use vMotion or live migration. Pick VMs that aren't critical or that have low CPU needs.
- If you don't have another host, add more physical cores. Maybe your server still has a free CPU socket. Or you can add more cores to the CPU if the motherboard supports it. Check your server's manual.
- As a temporary fix, limit the CPU usage of non-critical VMs. In vCenter, edit the VM settings, go to Resources, and set a CPU Limit. For example, limit a test VM to 2 GHz. It will run slower, but the important VMs won't wait as much.
Expected outcome: After moving VMs or adding cores, the host CPU usage should drop below 70%. CPU Ready time should drop below 5%. Your VM's applications should respond faster.
2. VM Has Too Many vCPUs – Oversized Virtual Machine
This one catches a lot of people. You think "more vCPUs = faster VM." But hypervisors don't work that way. If you give a VM 16 vCPUs, the hypervisor has to find 16 free logical cores at the same time before it can run that VM. That's harder than finding 2 free cores.
You'll see this with databases and old apps that were moved from physical servers. The physical server had 16 cores, so you gave the VM 16 vCPUs. But the application only uses 4 or 6 of them. The rest sit idle, but the hypervisor still has to schedule them.
How to check if your VM has too many vCPUs
- Log into the VM itself. For Windows VMs, open Task Manager. Go to the Performance tab. Look at the CPU usage graph. If you see a lot of idle cores (90% idle), you have too many vCPUs.
- For Linux VMs, run the command
toporhtop. Check the number of CPUs listed at the top. Then look at the %idle for each core. If most cores show over 80% idle, you have too many vCPUs. - Back in your hypervisor, check the same CPU Ready metric from step 1. If CPU Ready is high but the VM's own CPU usage is low, oversizing is your problem.
Fix it: Reduce vCPUs to match the actual workload
- Shut down the VM.
- Edit the VM settings. Reduce the number of virtual CPUs.
- For a database server: start with 4 or 8 vCPUs. For a file server: 2 or 4 is usually enough. For a web server: 2 vCPUs often covers most traffic.
- Power the VM back on.
Expected outcome: After reducing vCPUs, CPU Ready time should drop by half or more. The VM's applications should run at the same speed or faster because the hypervisor can schedule the VM more easily.
3. Resource Pools or Shares Are Misconfigured
Sometimes the host has enough CPU, and the VM has the right number of vCPUs. But the VM still gets high CPU contention because of how resources are divvied up between VMs. This is almost always the fault of resource pools or CPU shares settings that were set years ago and forgotten.
You'll see this when one VM has a resource pool with a high CPU limit, and another VM is trying to burst but can't get more CPU time. Or someone set CPU shares to "High" for a test VM and "Normal" for a production VM.
How to check shares and resource pools
- In vCenter, right-click the VM you're troubleshooting. Go to Edit Settings, then Resources tab.
- Look at CPU Shares. The default is "Normal" which gives 1000 shares per vCPU. If you see "High" (2000 shares per vCPU) or "Low" (500 shares per vCPU), someone changed it.
- If the VM is inside a resource pool, check the pool settings. Go to the host, then Resource Pools. Select the pool, go to the Summary tab. Look at CPU Reservation and CPU Limit.
- If CPU Limit is set to a low number (like 2 GHz) but the VM needs 8 GHz, that's your problem.
Fix it: Reset shares to Normal and remove unnecessary limits
- For each VM that has custom shares, set them back to "Normal." This ensures all VMs get a fair share of the CPU.
- For resource pools: remove the CPU Limit entirely. If you set a limit, the VM can't use more than that, even if the host has spare CPU.
- Only use CPU Reservations if a VM absolutely needs a guaranteed amount of CPU. For example, a domain controller might need a 2 GHz reservation. Most VMs don't need reservations.
Expected outcome: After resetting shares and removing limits, you should see the VM's CPU Ready time drop. The VM will be able to use the host's available CPU more freely.
Quick-Reference Summary
| Cause | How to Spot It | Fix |
|---|---|---|
| Host overloaded | Host CPU > 80%, CPU Ready > 10% | Move VMs to other hosts or add physical CPU cores |
| VM too many vCPUs | VM's own CPU usage low but CPU Ready high | Reduce vCPUs to match actual workload (4-8 usually enough) |
| Bad resource pools/shares | CPU limit set, shares set to High or Low | Reset shares to Normal, remove CPU limits |
Was this solution helpful?