Before you jump to conclusions as to what to monitor in CPU performance, you need to make sure that you know what affects CPU performance. Things that can affect CPU performance include:
- CPU affinity: When you pin down a virtual CPU to a physical CPU, it may happen that your resource gets imbalanced. So this is not advised, until you have a strong reason to do that.
- CPU prioritization: When CPU contention happens, the CPU scheduler will be forced to prioritize VMs based on entitlement and queue requests.
- SMP VMs: If your application is not multithreaded, then there is no benefit in adding more CPU resources in VMs. In fact, the extra idle vCPUs add overhead that prevents some more useful work from being done.
- Idle VMs: You may have too many idle VMs, which you think should not eat up resources. However, in reality, However, in reality, even idle VMs can affect CPU performance if the VM shares or reservations have been changed from their default values.
So, now you know what affects CPU performance. You can now look at what it takes to monitor it.
You can categorize the factors that should be monitored for CPU performance into three main sections:
- Host CPU usage
- VM CPU usage
- VM CPU ready time
To monitor these sections, you need to know the esxtop counters, and they are:
- PCPU Used (%)
- Per group statistics:
- %Used
- %Sys
- %RDY
- %Wait
- %CSTP
- %MLMTD