Skip to content
The Bits That Byte
  • About
November 13, 2011 / Hyper-V

Hyper-V VM Performance Tip: Move the Page File (pagefile.sys) to Another Virtual Disk

Your Virtual Machine Guests in Hyper-V should be treated like any other Operating System. They should be updated, defragmented, monitored, and fine tuned for performance.

Here is the primary link you will want to reference for installation, configuration, and performance of Hyper-V Virtual Machines: http://technet.microsoft.com/en-us/library/cc753637(WS.10).aspx (Don’t forget to use the Best Practices Analyzer for Hyper-V!)

Specifically, we want to focus on one area in this Perfomance Tip: Creating a Swap Disk to store the Paging File (Pagefile or pagefile.sys). Just like a physical box, the virtual machine can gain performance by moving the Paging File off of the boot drive. This can be acheived as follows:

1) Shutdown your Virtual Machine.

2) Create a Fixed Virtual Disk that is 1.5 times the amount of RAM your Virtual Machine is using. Example, if your VM has 4 GB allocated to it, your Fixed Disk would be 6 GB (I prefer 2 times the amount in my builds, so mine would be 8 GB). If you can store the Fixed Disk on a really fast drive, such as an SSD, the better off you will be. As a general rule, if you can’t afford an SSD (and who can!), try to make sure that your physical hard disks are operating at 7200 RPM or more. It is important to note that the best gains will be achieved by having this fixed virtual disk on a separate physical disk/controller than your boot virtual disk.

3) Attach the Fixed Virtual Disk to your Virtual Machine as an IDE to the second IDE Controller (IDE Controller 1). It is critical that you attach the disk as an IDE and not SCSI as the SCSI controller is synthetic (Its the same reason why you can’t boot from it).

4) Start up your Virtual Machine.

5) With your Swap File (the Fixed Virtual Disk) now in place, you can move the page file by the following. Please note that these instructions are for Server 2008 R2 SP1 but apply to other Windows based Operating Systems:

– Right click on Computer and select Properties, then select Advanced system settings.

– Under the Advanced tab, in the Performance section, select Settings.

– Under the Advanced tab of Performance Options in the Virtual memory section, select Change.

– Uncheck “Automatically manage paging file size for all drives”.

– Set a Custom Size of 1.5 times your VM memory (or 2 times in my case) on the Fixed Disk you determined to use as your Swap Drive. The Initial and Maximum Size should be the same. Example. if 8 GB is 2 times your physical memory, set the Initial and Maximum to 8 GB.

– Reboot your Virtual Machine.

– IMPORTANT: Upon reboot, go back to the Virtual memory settings and make sure to leave at least 16 MB (by setting the Intial and Maximum Custom Size to 16 MB) on the boot drive for paging. While we are moving the primary load to another disk, you may need this in case your Swap Drive becomes unavailable!

– Reboot one final time and enjoy the increased performance.

Post navigation

Previous Post:

SharePoint 2010 Service Pack 1 (SP1) Announced/Expected End of June Release

Next Post:

Know Your Limits: Capacity planning for Hyper-V Virtual Machines

7 Commments

  1. scape says:
    July 18, 2011 at 8:16 pm

    I was thinking of putting together a stripe of 10k or 15k hdd’s to hold just page file vhd’s for some of the vm’s I have running. Using your method, do you think this would be of use?

    Reply
    1. Kelly says:
      July 20, 2011 at 2:01 pm

      This would be useful as the IO load is being shifted to other disks. I would also look at some of the free benchmark software out there to see the before and after effects of performing such a move. Nothing beats a measurable baseline.

      Reply
  2. Michael says:
    July 20, 2011 at 4:29 pm

    wow kelly.. great post.. I was having issues with my virtual machine on hyper-v which wouldn’t allow me to move the paging file to any other disk other than the C drive.. your comment about SCSI not supported (point 3) saved a lot of time troubleshooting.
    Thanks,
    Michael

    Reply
    1. Kelly says:
      July 22, 2011 at 1:07 pm

      Happy to help Michael. Best of luck with your Hyper-V endeavors!

      Kelly

      Reply
  3. madshark says:
    September 23, 2011 at 7:41 am

    Hi, I presume your artcile is aimed at non-clustered environments and not using shared storage? If you move the pagefile to a seperate VHD but that is on the same storage subsystem / controller then I cant see how you would get a performance benefit?

    Reply
    1. Kelly says:
      September 24, 2011 at 5:37 pm

      Hi Madshark,

      You are correct, the greatest gains would be on a separate disk/controller. You might see some very slight gains on the same disk/controller since a VHD is encapsulated, but the best bet woudl be to move to separate storage.

      Good luck,

      Kelly

      Reply
  4. Reese33 says:
    August 3, 2014 at 1:33 pm

    Hi, if I follow the article I finally have a 2 page file.
    In my case, one of D partition of 12Go and one on C partition of 16Mo.
    After rebooting, I have one file of 12Go in partition B and one of 16Mo in partition C.
    In the Advanced tab, in the Performance section, just above Settings, I see 12302 (16 + 12286) for Total paging file size for all drives.
    I’m wondering which page file is used by the OS? How do you know that Windows use the D one by default? (Because its size is more important?)
    Thanks.
    PS : you can add in the article to not put a page file in a partition with the letter A or B, that doesn’t work 🙂

    Reply

Leave a Reply to scape Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sitecore Technology MVP

Categories

  • AngularJS
  • Azure
  • CSS3
  • HTML5
  • Hyper-V
  • JavaScript
  • jQuery
  • OneDrive
  • PowerShell
  • Responsive Web Design
  • Search
  • SEO
  • SharePoint
  • Sitecore
  • SQL 2008 R2
  • SQL 2012
  • Tech Review
  • Tech Toy
  • Technical Resources
  • Uncategorized
  • Visual Studio
  • Web Content Management
  • Windows 8
  • Windows 8 App
  • Windows App
  • Windows Server 2008 R2
  • Workflow

Sponsored Links

Recent Posts

  • Sitecore Commerce 10.0.0 Bootstrap 404 Error and Other Changes
  • How to Run Cost Effective Sitecore Environments in Azure
  • Autofail: A Big Azure Autoscale Limitation and What To Do
  • Got Fixes? A Sitecore Troubleshooters Guide to Sitecore Hotfixes
  • Sitecore 10 Application Roles, Storage Roles, and Indexes

Blogroll

  • Colins Sitecore Tech Blog
  • Sitecore Architecture – Grant's Sitecore Rants
February 2021
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
« Jan    
© 2021 thebitsthatbyte.com - Powered by SimplyNews