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:
-
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.)
-
For each ESX host in the cluster, configure the SWAP to point to the SWAP data store.
-
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.
-
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.
-
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:
- ESX Swap File Size Best Practice
- Free Tool – Veeam FastSCP For ESX and ESXi
- Capacity Planning and Monitoring for VMware Virtual Infrastructure
- My Microsoft Hyper-V and Virtual Machine Manager Event Key Notes
- P2V – Step by Step Removing Physical Hardware
Originally posted 2009-02-08 07:49:24. Republished by Blog Post Promoter








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”.
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