Beruflich Dokumente
Kultur Dokumente
Before diving into memory overcommitment or memory contention I would like to first
show the hypervisor architecture so that it becomes easy to understand concepts
described below.
------------VM-------------
Guest Virtual memory (VA)
Application
O.S
Virtual Hardware
VM Kernel
Physical RAM
<--------------Hypervisor-----------------------
VA is mapped directly to GA and GA in turn is mapped to HA.
Shadow Page Table: Shadow page tables are used by the hypervisor to keep track of
the state in which the guest "thinks" its page tables should be. The guest can't be allowed
access to the hardware page tables because then it would essentially have control of the
machine. So, the hypervisor keeps the "real" mappings (guest virtual -> host physical) in
the hardware when the relevant guest is executing, and keeps a representation of the
page tables that the guest thinks it's using "in the shadows,".
vSwap: For every VM there exists a vswap file (created when vm is powered on) and it is
used when Esxi host memory is not sufficient for satisfying the memory needs of the VM.
Pagefile: Pagefile exists inside the guest O.S and is only used when VMs memory is not
sufficient to satisfy Applications need.
What is Memory Overcommitment in Esxi Server?
ESXI is said to be memory overcommitted when VMs are powered on such that their total
configured memory size is greater than ESXI memory
Alex_Hunt (www.alexhunt86.wordpress.com)
Introduction
Memory overcommitment in ESXI is very similar to that in traditional operating systems
(OS) such as Linux and Windows. In traditional OSes, a user may execute applications,
the total mapped memory of which may exceed the amount of memory available to the
OS. This situation is known as memory overcommitment. If the applications consume
memory which exceeds the available physical memory, then the OS reclaims memory
from some of the applications and swaps it to a swap space. It then distributes the
available free memory between applications.
Similar to traditional OSes, ESXI allows VMs to power on with a total configured memory
size that may exceed the memory available to ESXI. The memory installed in an ESXI
Server is called ESXi memory. If VMs consume all the ESXI memory, then ESXI will
reclaim memory from VMs. It will then distribute the ESXI memory, in an efficient and
fair manner, to all VMs such that the memory resource is best utilized.
A simple example of memory overcommitment is when two 4GB VMs are powered on in
an ESXI Server with 4GB of installed memory. The total configured memory of poweredon VMs is 2 * 4 = 8GB, while ESXI memory is 4GB.
Memory overcommitment enables a higher consolidation ratio in a hypervisor. Using
memory overcommitment, users can consolidate VMs on a physical machine such that
physical resources are utilized in an optimal manner while delivering good performance.
For example in a virtual desktop infrastructure (VDI) deployment, a user may operate
many Windows VMs, each containing a word processing application. It is possible to
overcommit a hypervisor with such VDI VMs.
Since the VMs contain similar OSes and applications, many of their memory pages may
contain similar content. The hypervisor will find and consolidate memory pages with
identical content from these VMs, thus saving memory. This enables better utilization of
memory and enables higher consolidation ratio.
Memory overcommitment in ESXI is reliable. This implies that VMs will not be
prematurely terminated or suspended owing to memory overcommitment. Memory
overcommitment in ESXI is theoretically limited by the overhead memory of ESXI. ESXI
guarantees reliability of operation under all levels of overcommitment.
Alex_Hunt (www.alexhunt86.wordpress.com)
Alex_Hunt (www.alexhunt86.wordpress.com)
When the memory state hits High, the hypervisor call TPS immediately even if it is not
due for another run.
2: Memory ballooning is an active method for reclaiming idle memory from VMs. It is
used when ESXI is in the soft state. If a VM has consumed memory pages, but is not
subsequently using them in an active manner, ESXi attempts to reclaim them from the
VM using ballooning.
In this method, non-active pages from VM memory will be moved to VMs pagefile and
GA-HA memory mapping will be deleted. Esxi then allocated those free memory space
which was created due to GA-HA mapping deletion and provides that space to other VMs
which are demanding memory. Ballooning first reclaims free memory pages then it goes
for idle pages and in last it reclaims from active memory pages.
*** Max 65% of memory allocated to VM can be reclaimed using Ballooning.
3: Memory Compression: In this technique there is a small area known as memory
compression area resides in the memory which is allocated to a VM and when this
technique is triggered idle pages of VM is kept inside this area.
Mem Comp Area
ESX has an associated memory state which is determined by the amount of free ESX
memory at a given time. The states are high, soft, hard, and low. Table 1 shows the
ESX state thresholds. Each threshold is internally split into two sub-thresholds to avoid
Alex_Hunt (www.alexhunt86.wordpress.com)
oscillation of ESX memory state near the threshold. At each memory state, ESX utilizes a
combination of memory reclamation techniques to reclaim memory. This is shown in
Table 2.
Table 1. Free memory state transition threshold in ESX. (a) User visible. (b) Internal
threshold to avoid oscillation.
STATE TPS
high
soft
hard
low
Alex_Hunt (www.alexhunt86.wordpress.com)
Alex_Hunt (www.alexhunt86.wordpress.com)