Partilhar via


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

clip_image001 Proper paging file configuration is vital to the way DM performs

clip_image001[1] DM requires that the VM have a PF

clip_image001[2] So how do you size your Paging File?

clip_image002 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:

clip_image001[4] Current Commit: 100 MB

clip_image003 Free Buffer: 20%  (this is a new Dynamic Memory Setting)

clip_image003[1] Target Commit: 125 MB

clip_image003[2] Paging File: 1MB

clip_image003[3] Commit Limit: 126 MB

clip_image003[4] Available Memory: 26 MB (Commit Limit – Current Commit)

clip_image001[5] What happens when an app allocates 50 MB of memory?

clip_image003[5] What happens when an app allocates five 10 MB memory chunks?

Guidance:

clip_image001[6] 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.

clip_image003[6] 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;

clip_image004 Hyper-V Dynamic Memory Balancer

    • 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

clip_image004[5] Hyper-V Dynamic Memory VM

    • 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…