
Sizing Memory for Virtual Machines
Deploying Microsoft Windows 7 Virtual Desktops with VMware View Applied Best Practices
31
Assigning RAM to virtual machines
The goal in choosing the appropriate RAM size for the golden image virtual machines is to give
the virtual machines enough memory to hold the entirety of the working set in memory while
keeping the memory over-commit ratio as low as possible. This avoids Windows having to page
because there is not enough RAM available in the guest OS. It also avoids ESX having to swap
because it cannot reclaim memory from active guests fast enough when experiencing sufficient
memory demand.
To determine how much RAM to allocate to the golden image virtual machine, the guest should
be placed under load. With the peak load running on the virtual machine the amount of active
memory needs to be measured. This is called the active working set size.
There are several methods to measure the active working set size. In esxtop, look at the %ACTV
memory counter. This will display the active working set size as a percentage of allocated
memory. If this value never approaches 100 percent then the virtual machine is not actively using
all RAM allocated to it.
In vCenter it is reported as Active under the
Guest Memory section on the Resource
Allocation
tab. Alternatively, for more accurate measurement launch VM Statistics Logging on
the VM and observe the
Memory Active counter under VM Memory.
For the best balance between performance and memory utilization it is suggested that the virtual
machine have at least 25 percent more RAM allocated than the maximum active load the VM
witnessed to avoid having Windows write data to its page file. This keeps the active working set
for the virtual machine in RAM instead of virtual memory space.
For example, if the golden image virtual machine has a peak active memory threshold of
600 MB, then the virtual machine should have at least
750 MB of RAM allocated. The
maxi
mum number of virtual machines to load on the host can be calculated by dividing the
maximum amount of ESX host memory by the maximum active memory of the golden virtual
machine. In this case it would be 32,768 / 600 = 54 virtual machines. This provides a safe over-
commit ratio of approximately 1.25 to 1 if you do not factor in virtual machine and ESX memory
overhead.
Additionally, when Windows is booted it zeros out its memory space. This causes the
%ACTV memory to briefly run up to 100 percent. This can lead to periods of vswap usage if
multiple virtual machines are rebooted in concert as could happen in the event of an ESX host
failure, or when VMware HA is enabled for the cluster.
Komentarze do niniejszej Instrukcji