Recipe: 5.9 Monitoring CPU Usage - VMWare Cookbookby Ryan Troy and Matthew Helmke
You want to monitor your ESX server’s CPU usage.
This excerpt is from VMWare Cookbook. This book provides a look into real-world use of VMware ESX and ESXi, with step-by-step solutions for problems that occur in a wide range of environments. Written by experts with experience using VMware in a production environment, VMware Cookbook shares tips and tricks earned through trial and error, and supplies the background you need to apply them.
Use the esxtop utility.
From the command line on your ESX server, run the following:
If you are familiar with the Unix top utility, esxtop will feel similar. Once esxtop is running, press
c to switch to CPU mode. This will display your server’s current CPU usage statistics (Figure 5.5, “esxtop default CPU display”).
Figure 5.5. esxtop default CPU display
The first line displayed tells you:
The current time (8:56:45 a.m., in our example)
The time elapsed since the last reboot
The number of currently running worlds (VMware virtual machines)
CPU averages over 1, 5, and 15 minutes
PCPU(%) line displays the percentage of CPU utilization per physical CPU and the total average across all the physical CPUs.
CCPU(%) line shows the CPU time as reported by the ESX server or console. This is a user time variable, as opposed to the PCPU, which measures time from the CPU’s point of view.
Below the PCPU and CCPU lines, the following attributes are available:
The number of the processor
The ID of the running world’s resource pool
The name of the currently running process
The number of worlds in the group
The percentage of physical CPU used by the resource pool, virtual machine, or world
The percentage of total time scheduled (not taking into account hyper-threading and system time)
System time: the time that elapses while kernel code is running
The total percentage of time the resource pool or world has spent in a wait state
The percentage of time the resource pool, virtual machine, or world has spent ready to run but waiting to get a CPU
The percentage of time the VCPU world has spent in an idle loop (this applies only to the VCPU world; for other worlds, this field will be zero)
The percentage of time spent by system services working on behalf of other worlds
The percentage of time the world has spent in a ready, co-descheduled state (this state applies only to SMP VMs)
The percentage of time the world spent ready to run but deliberately wasn’t scheduled to avoid violating the CPU limit settings
You can find additional information regarding performance monitoring at http://communities.vmware.com/servlet/JiveServlet/download/2380-17272/technote_PerformanceCounters-11-03-08.pdf.
If you enjoyed this excerpt, buy a copy of VMWare Cookbook.