Information Technology Reference
In-Depth Information
h e key advantage that ESXi gains from using a guest-OS-specifi c balloon driver in this fashion is
that it allows the guest OS to make the decision about which pages can be given to the balloon driver
process (and thus released to the hy per v isor). In some cases, the infl ation of the balloon driver can
release memory back to the hypervisor without any degradation of VM performance because the
guest OS is able to give the balloon driver unused or idle pages.
Memory Compression
From vSphere 4.1, VMware added another memory-management technology to the mix: mem-
ory compression. When an ESXi host gets to the point that hypervisor swapping is necessary,
the VMkernel will attempt to compress memory pages and keep them in RAM in a compressed
memory cache. Pages that can be successfully compressed by at least 50 percent are put into the
compressed memory cache instead of being written to disk and can then be recovered much
more quickly if the guest OS needs that memory page. Memory compression can dramatically
reduce the number of pages that must be swapped to disk and thus can dramatically improve
the performance of an ESXi host that is under strong memory pressure. There is a coni gurable
amount of VM memory used for the compression cache (by default 10 percent), but this starts at
zero and grows as needed when VM memory starts to be swapped out. Compression is invoked
only when the ESXi host reaches the point that VMkernel swapping is needed.
Swapping
There are two forms of swapping involved when you examine how memory is managed with
VMware ESXi. There is guest OS swapping , in which the guest OS inside the VM swaps pages out
to its virtual disk according to its own memory-management algorithms. This is generally due to
memory requirements that are higher than available memory. In a virtualized environment, this
would translate into a VM being coni gured with less memory than the guest OS and its appli-
cations require, such as trying to run Windows Server 2008 R2 in only 1 GB of RAM. Guest OS
swapping falls strictly under the control of the guest OS and is not controlled by the hypervisor.
The other type of swapping involved is hypervisor swapping . In the event that none of the
previously described technologies trim guest OS memory usage enough, the ESXi host will be
forced to use hypervisor swapping. Hypervisor swapping means that ESXi is going to swap
memory pages out to disk in order to reclaim memory that is needed elsewhere. ESXi's swap-
ping takes place without any regard to whether the pages are being actively used by the guest
OS. As a result, and due to the fact that disk response times are thousands of times slower than
memory response times, guest OS performance is severely impacted if hypervisor swapping is
invoked. It is for this reason that ESXi won't invoke swapping unless it is absolutely necessary,
as a last resort after all other memory management techniques have been tried.
The key thing to remember about hypervisor swapping is that you want to avoid it if at all
possible; there is a signii cant and noticeable impact to performance. Even swapping to SSD
(Solid State Drive) is considerably slower than directly accessing RAM.
Although these advanced memory-management technologies allow ESXi to allocate more
memory to VMs than there is actual RAM in the physical server, they do not help guarantee mem-
ory or prioritize access to memory. Even with these advanced memory-management technologies,
at some point it becomes necessary to exercise some control over how the VMs access and use
the memory allocated to them. This is where a VMware vSphere administrator can use reserva-
tions, limits, and shares—the three mechanisms described previously—to modify or control how
Search WWH ::




Custom Search