What’s the story of Pagefile size on Hyper-V Servers?
This question comes up frequently. So, how do we size the pagefile on Hyper-V host servers and how about Virtual Machines?
Here’s the all you should know;
Paging File Configuration within the VM
Proper paging file configuration is vital to the way DM performs
The old way doesn’t apply to DM:
- Use Peak Commit Charge
- Size PF to Peak Commit Charge – Physical Memory + some buffer
To understand how we should size the PageFile (PF), let’s consider an example:
What happens when an app allocates five 10 MB memory chunks?
Guidance:
Minimum PF should be large enough to cover the memory demands of your largest process. In the case of application allocating 50 MB of memory, the allocations request will fail with out of virtual memory error. When application allocates 10 MB chunks, the first two allocations will go through while the rest will fail as there’s no virtual memory (either RAM or PF) to accommodate that.
Maximum PF should be (peak commit charge – maximum physical memory + some buffer)
Paging File Configuration on the host
If you have reserved enough RAM for the host operations and your host is only being used for Hyper-V (plus Fail Over Cluster for HA VMs), you shouldn’t need a large pagefile.
With Dynamic Memory, you have to make sure that your host reserve is set properly
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization
Value Name: MemoryReserve
Value Type: DWORD
Value Data: (Decimal)Memory to reserve in MB
With a properly configured host reserve, if you follow (Peak Commit Charge – Physical Memory + some buffer) formula on the host, you’ll find out that you don’t need a page file.
So, Pagefile size of min= few Gigabyte and Max=2xmin should be sufficient.
Also, there are 2 new performance counter objects available to the Hyper-V host;
-
- Provides counters about the memory balancer running in the parent partition
-
- Counters are focused on:
-
- The memory that is available for the host to use
-
- The add and remove operations performed by the memory balancer
-
- Provides counters about memory usage on the guest VMs that are currently running
-
- Each VM has its own set of counters
-
- Counters are focused on:
-
- Memory added and removed from the guest
-
- The memory pressure that the guest is experiencing
Hope this helps! so long…