VMware VMkernel SWAP File Best Practice

VM guest swap file diagram

VM guest swap file diagram

Answering the question that always seems to get asked, “what is the best practice for the VM SWAP file?”

I have put this method through bench testing and found it to have the best performance, step by step for VM SWAP file configuration is:
  1. Set up a data store in each ESX cluster for guest SWAP files, see diagram to the right. (Do not use local ESX disks! This will save more expensive SAN storage but causes latency for DRS and vMotioning of VMs.)
  2. For each ESX host in the cluster, configure the SWAP to point to the SWAP data store.
  3. Go through all the setting on each VM in the cluster and make sure VM SWAP file are controlled by the host, not in VM folder.
  4. Here’s a step that some will disagree on but my testing has found it to produce the best VM performance, log into the Windows VM and set the SWAP file to be maintained by Windows. Some admins like to do 2.5 – 3.5 ratio for the memory but this is not a physical so let Windows adjust the SWAP file size. From what I have found it’s a 1:1 ratio.
  5. Configure 1 – 3 the same for Linux but on 4 just let Let Linux do it’s own thing. Linux uses a SWAP volume which is stored in the VM’s folder.
My test results produced:  Faster VM Booting, Better VM Performace, Faster vMotioning and DRS, Faster VM evacuation when ESX host is entering maintenance mode

Similar Posts:

High quality Step by Step training videos on VMware Virtualization technology. Find out more!
vSphere 5 Documentation Center Search Results on Best Practices. Find out more!

4 Responses to VMware VMkernel SWAP File Best Practice

  • ChrisAug says:

    I agree with the principle in regards to VM Swap files, but your title is named “Guest Swap File Best Practice”. This means the swap file for each individual guest VM (which is what I am looking for). So like I said, The best practice is correct, just change the title and remove the word “Guest”.

  • editor says:

    Chris,

    Good catch. This can be confussing. I have updated the post per your recommendation. Thx

    FYI, on something that may help you. I’ve heard and used 2 methods for best practices on the actual VM:

    1. Turn off the page file and allocate more memory as needed. Improves performance.

    2. On Windows, change to allow Windows to manage the swap file. Maximizes memory.

    Hope this helps!

    Joe

  • Mike says:

    Any suggestions on the storage characteristics for the swap data store.

    For example:
    RAID type?
    IOPS?
    Size?

    Thanks

  • Mike says:

    This article applies to VMKernel Swap files, not VM Guest swap files. What it says is correct, but you should change the title so it reflects what the article is taking about.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Affiliate
vmware vsphere training
Advertisement
Advertisement