Thursday, April 12, 2012

Memory Compression

ESX/ESXi provides a memory compression cache to improve virtual machine performance when you use memory overcommitment. Memory compression is enabled by default. When a host's memory becomes overcommitted, ESX/ESXi compresses virtual pages and stores them in memory.

Because accessing compressed memory is faster than accessing memory that is swapped to disk, memory compression in ESX/ESXi allows you to overcommit memory without significantly hindering performance. When a virtual page needs to be swapped, ESX/ESXi first attempts to compress the page. Pages that can be compressed to 2 KB or smaller are stored in the virtual machine's compression cache, increasing the capacity of the host.

You can set the maximum size for the compression cache and disable memory compression using the Advanced Settings dialog box in the vSphere Client.

Enable or Disable the Memory Compression Cache
Memory compression is enabled by default. You can use the Advanced Settings dialog box in the vSphere Client to enable or disable memory compression for a host.

Procedure
1 Select the host in the vSphere Client inventory panel and click the Configuration tab.
2 Under Software, select Advanced Settings.
3 In the left pane, select Mem and locate Mem.MemZipEnable.
4 Enter 1 to enable or enter 0 to disable the memory compression cache.
5 Click OK.

Set the Maximum Size of the Memory Compression Cache

You can set the maximum size of the memory compression cache for the host's virtual machines.

You set the size of the compression cache as a percentage of the memory size of the virtual machine. For example, if you enter 20 and a virtual machine's memory size is 1000 MB, ESX/ESXi can use up to 200MB of host memory to store the compressed pages of the virtual machine.

If you do not set the size of the compression cache, ESX/ESXi uses the default value of 10 percent.
Procedure
1 Select the host in the vSphere Client inventory panel and click the Configuration tab.
2 Under Software, select Advanced Settings.
3 In the left pane, select Mem and locate Mem.MemZipMaxPct.
The value of this attribute determines the maximum size of the compression cache for the virtual machine.
4 Enter the maximum size for the compression cache.
The value is a percentage of the size of the virtual machine and must be between 5 and 100 percent.
5 Click OK.

http://www.vmware.com/pdf/vsphere4/r41/vsp_41_resource_mgmt.pdf

No comments:

Post a Comment