Search the VMware Knowledge Base (KB)
View by Article ID

Impact of virtual machine memory and CPU resource limits (1033115)

  • 15 Ratings
Language Editions

Purpose

This article provides information about the impact of virtual machine resource limits on CPU and memory.  A virtual machine experiences poor performance even though the ESX host is not fully utilized.  Ballooning and vmkernel swapping occur

Resolution

Resource limits on a virtual machine for both CPU and memory form an artificial boundary for the virtual machine.

Memory Limits

When a memory limit is set less than the virtual machine's provisioned memory, it is considered as the upper boundary for the amount of physical memory that can be directly assigned to this particular virtual machine. The guest operating system is not aware of this limit, and it optimizes memory management options to the assigned memory size.
 
When the limit is reached or exceeded, the guest operating system can still request new pages, but due to the limit the VMkernel does not allow the guest to directly consume more physical memory and treats the virtual machine as if the resource is under contention. Memory reclamation techniques are used to enable the virtual machine to consume requested memory.
 
Depending on the number of pages requested by the virtual machine, the VMkernel might resort to VMkernel swap to fulfil the request, in the worst case scenario. The VMkernel first tries to reclaim memory by inflating the Balloon Driver to let the guest memory manager decide what to page out. In ESX 4.1, the VMkernel also tries to compress memory pages before swapping them out.
 
You can verify the impact of a memory limit by running esxtop and looking at  MCTLSZd and MCTLTGT, SWCUR and SWTGT, and CACHEUSD.
 
For more information on using esxtop, see Interpreting esxtop Statistics.
 
CPU Limits
 
When a CPU Limit is set on a virtual machine resource setting, the virtual machine is deliberately held from being scheduled to a PCPU when it has used up its allocated CPU resource. This happens regardless of the CPU utilization. If the limit is set to 500MHz, the virtual machine is rescheduled from the PCPU and has to wait before it is allowed to be scheduled again. As such, the virtual machine might experience performance degradation.
 
Note: For an SMP virtual machine, the sum of all vCPUs cannot exceed the specified limit. For example, 4 vCPU virtual machine with a limit of 1200MHz and equal load among vCPUs would result in a max of 300MHz per vCPU.
 
You can verify the impact of a CPU limit by running esxtop and looking at  %RDY and %MLMTD.
 
For more information on using esxtop, see Interpreting esxtop Statistics.

Additional Information

You can also use shares to restrict resource usage of certain virtual machines only when the host becomes overcommitted.
 
You can use a limit to simulate resource over commitment in advance or to dynamically constrain the resource usage of a virtual machine (for example, in case a rogue virtual machine's excessive resource utilization negatively affects the host and the other virtual machines).

For more information on how memory management works:

For related information, see:

Tags

memory limits,cpu limits,virtual machine memory,utilization

See Also

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 15 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 15 Ratings
Actions
KB: