Popular Post

_

Friday, December 13, 2013

CMG’13 paper about VMware memory over-commitment, Memory State performance counter, Ballooning, Swapping and Memory Reservations. A few citations.

 I have attended the Performance Management in the Virtual Data Center: Virtual Memory Management  Mark’s B. Friedman presentation and learned a lot. I would like to share here a few most informative (by my opinion) citations from Mark’s paper about

-        Memory over-commitment
-        Memory State performance counter,
-        Ballooning, Swapping and
-        Memory Reservations.

Introduction.
“…This paper explores the strategies that VMware ESX employs to manage machine memory, focusing on the ones that are designed to support aggressive consolidation of virtual machine guests on server hardware..”

Memory over-commitment
“…Allowing applications to collectively commit more virtual memory pages than are actually present in physical memory, but biasing the contents of physical memory based on current usage patterns, permits operating systems that support virtual memory addressing to utilize physical memory resources very effectively…”

Memory State performance counter
“…VMware’s current level of physical memory contention is encapsulated in a performance counter called Memory State. This Memory State variable is set based on the amount of Free memory available. Memory state transitions trigger the reclamation actions reported in Table 1:

State
Value
Free Memory Threshold
Reclamation Action
High
0
> 6%
None
Soft
1
< 6%
Ballooning
Hard
2
< 4%
Swapping to Disk or Pages compressed
Low
3
<2 span="">
Blocks execution of active VMs > target allocations
..”

Ballooning
“…ballooning occurs when the VMware Host recognizes that there is a shortage of machine memory and must be replenished using page replacement. Since VMware has only limited knowledge of current page access patterns, it is not in a position to implement an optimal LRU page replacement strategy. Ballooning attempts to shift responsibility for page replacement to the guest machine OS, which presumably can implement a more optimal page replacement strategy than the VMware hypervisor.
…  Using ballooning, VMware reduces the amount of physical memory available for internal use within the guest machine.

In Windows, when VMware’s vmmemsty.sys balloon driver inflates, it allocates physical memory pages and pins them in physical memory until explicitly released. To determine how effective ballooning works to relieve a shortage of machine memory condition, it is useful to drill into the guest machine performance counters and look for signs of increased demand paging and other indicators of memory contention….

…ballooning successfully transforms the external contention for machine memory that the VMware Host detects into contention for physical memory that the Windows guest machine needs to manage internally...”

Swapping
“… VMware has recourse to steal physical memory pages granted to a guest OS at random, which VMware terms swapping, to relieve a serious shortage of machine memory. When free machine memory drops below a 4% threshold, swapping is triggered..”

Memory Reservations.

“In VMware, customers do have the ability to prioritize guest machines so that all tenants sharing an over-committed virtualization Host machine are not penalized equally when there is a resource shortage. The most effective way to protect a critical guest machine from being subjected to ballooning and swapping due to a co-resident guest is to set up a machine memory Reservation. A machine memory Reservation establishes a floor guaranteeing that a certain amount of machine memory is always granted to the guest. With a Reservation value set, VMware will not subject a guest machine to ballooning or swapping that will result in the machine memory granted to the guest falling below that minimum…”

No comments:

Post a Comment