CPU usage of an application differs in virtual machines compared to physical machines
search cancel

CPU usage of an application differs in virtual machines compared to physical machines

book

Article ID: 339777

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article describes why CPU usage for specific applications differs on ESX 2.x hosted virtual machines when compared to running on physical machines.


Environment

VMware ESX Server 2.1.x
VMware ESX Server 2.0.x
VMware ESX Server 2.5.x

Resolution

There are a number of factors that contribute to differences in CPU utilization measurements:

  • When a virtual machine is idle, it may either execute an idle loop or halt the CPU. Executing an idle loop consumes CPU resources on the host while the guest itself appears to be inactive. For more information, see ESX 2.5 reports increased CPU utilization for idle Microsoft Windows Server 2003 SP1 SMP virtual machines (1077) and ESX 2.5 reports increased CPU utilization for idle Microsoft Windows Server 2003 SP1 SMP virtual machines (1730).

  • The CPU utilization reported by native guest operating system tools like Windows Task Manager is relative to the CPU resources allocated to it by the host. For example, a virtual machine may be limited to 50 percent of a physical CPU by the host; this portion is what the guest operating system considers 100 percent. This differs greatly from an operating system running on a physical machine, which has access to 100 percent of the underlying physical CPU at all times, whether it is needed or not. For detailed information on the challenges of measuring the CPU load from within a virtual machine, please see page 17 of the white paper Timekeeping in VMware Virtual Machines at www.vmware.com/pdf/vmware_timekeeping.pdf.

  • Virtual machine CPU utilization reported by VMware virtual infrastructure monitoring tools (for example, esxtop) is in the context of physical CPU resources used on the host, not on the guest operating system.

  • Timer interrupts inside a virtual machine can occur in bursts due to the nature of scheduling multiple virtual machines by the host. This issue is covered in more detail in the white paper ESX Server Architecture and Performance Implications under the section, "Keeping Time in Virtual Machines," at www.vmware.com/pdf/esx2_performance_implications.pdf.

  • Differences in physical and logical CPUs may create the appearance of extreme differences in utilization. For example, a demanding single-threaded application running on a hyperthreaded physical CPU causes the task manager to report that only 50 percent of the CPU is utilized. However, the same application running on a single non-hyperthreaded or virtual CPU shows up in the task manager at 100 percent utilization, even though the same amount of processing is taking place.