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
DM requires that the VM have a PF
So how do you size your Paging File?
The old way doesn’t apply to DM: Use Peak Commit Charge Size PF to Peak Commit Charge – Physical Memory + some buffer
The old way doesn’t apply to DM:
To understand how we should size the PageFile (PF), let’s consider an example:
Current Commit: 100 MB
Free Buffer: 20% (this is a new Dynamic Memory Setting)
Target Commit: 125 MB
Paging File: 1MB
Commit Limit: 126 MB
Available Memory: 26 MB (Commit Limit – Current Commit)
What happens when an app allocates 50 MB of memory?
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;
Hyper-V Dynamic Memory Balancer
Hyper-V Dynamic Memory VM
Hope this helps! so long…