Windows DevCenter    
 Published on Windows DevCenter (http://www.windowsdevcenter.com/)
 See this if you're having trouble printing code examples


Recipe: 5.9 Monitoring CPU Usage - VMWare Cookbook

by Ryan Troy and Matthew Helmke

Monitoring CPU Usage

Problem

You want to monitor your ESX server’s CPU usage.

VMWare Cookbook book cover

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.

buy button

Solution

Use the esxtop utility.

Discussion

From the command line on your ESX server, run the following:

esxtop

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

esxtop default CPU display


The first line displayed tells you:

The PCPU(%) line displays the percentage of CPU utilization per physical CPU and the total average across all the physical CPUs.

The 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:

ID

The number of the processor

GID

The ID of the running world’s resource pool

NAME

The name of the currently running process

NWLD

The number of worlds in the group

%USED

The percentage of physical CPU used by the resource pool, virtual machine, or world

%RUN

The percentage of total time scheduled (not taking into account hyper-threading and system time)

%SYS

System time: the time that elapses while kernel code is running

%WAIT

The total percentage of time the resource pool or world has spent in a wait state

%RDY

The percentage of time the resource pool, virtual machine, or world has spent ready to run but waiting to get a CPU

%IDLE

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)

%OVRLP

The percentage of time spent by system services working on behalf of other worlds

%CSTP

The percentage of time the world has spent in a ready, co-descheduled state (this state applies only to SMP VMs)

%MLMTD

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.

Copyright © 2009 O'Reilly Media, Inc.