Thanks for the (dynamic) memory – Windows Server 2008 R2 sp1 beta

Although 16Gb laptops are out there I am making do with 8Gb, so any chance to get a bit more oomph out of it is always welcome and so I wanted to try the new dynamic memory capabilities in Windows Server 2008 R2. I am going out on a limb here because you shouldn’t use any beta code in production and essentially my demo rig is my production rig. However I caught up with the Hyper-V tsar Jeff Woolsey on our internal TechReady conference last week - he says it’s rock steady and that’s good enough for me!

I went for the the windows update install (from here) which just puts a flag in the windows update process to fool it into thinking the service pack is released code, and then forces the sp1 beta to install as an update.

Now when I look at the setting of my BI demo VM I can start to use dynamic memory.

dynamic memory bi2010

so what can you set and what difference does it make?

  • Startup RAM is essentially what we have now, so it;s the minimum RAM the virtual machine (VM) gets and the some of the strup RAM for the running VMs can’t exceed what’s on the physical server.  So this is nothing like the the over committing you will have seen in Vmware, but that’s a post for another day.
  • Maximum RAM is hopefully obvious as is
  • Memory priority.
  • Buffer reserve percentage controls how much free memory there should be on top of the amount of currently committed memory.  So the target memory the hypervisor is trying to assign to a given VM is

Currently committed memory + Free buffer memory

where

Free buffer memory=(1/(1-Free Buffer %)-1) X Currently committed memory

This is all fine when there is enough memory to go around all of the running VMs. When the there isn’t the priority setting is used to decide which VMs suffer.  You’ll need to be careful setting all of this as it is possible to set a up a scenario where a lower priority VM appears to be better served than a high priority one, by setting a high free buffer % on the lower priority VM.  This is to do with the way the memory balancer calculates the pressure each VM is under, the calculation for this being..

Current Committed memory/ Available memory

The other thing to be aware of is setting the page file appropriately.  If you have a small free buffer and a small page file and you suddenly launch a massive program or process in a VM it might fail because there won’t be sufficient free space.  However using the same VM with the same settings the memory could be gradually be increased beyond the limit that caused the big program to fail to start as on each occasion a little but more memory will be dynamically assigned to preserve the size of the free buffer.

How does this work?  Basically there are changes to the integration components put into the guest VM which can dynamically add memory and using ballooning to get it back again.  This ballooning process reserves chunks of memory in the guest VM that have been handed back to the host as once memory has been added it can’t be removed in the same way, or it would crash the guest VM or the apps running on it.

You might also be wondering how you control how much memory is left over for the physical OS and where you set this.  In the current beta this is dynamically set as part of the dynamic memory control in what’s called the memory balancer.  You can override this in the registry but my advice would be to understand what performance you are getting before you start this deeper level of tuning.

So for my little laptop I normally run three VMs and in the table below is how I have set them up now I have dynamic memory to play with:

VM Static Memory prior to sp1 min Memory max Memory Free Buffer Priority
Domain Controller 500Mb 500Mb 1500Mb 20% Lowest
Win 7 Client 1500Mb 1500Mb 65536Mb 20% medium
BI2010 4500Mb 4000Mb 65536Mb 20% high

Over the next few weeks I’ll see how this behaves compared to before and keep you posted.  In the meantime if you have some spare tin around you might want to conduct you’re own evaluation in which case you can get sp1 and a trial copy of Windows Server 2008 R2 if you haven’t got one all from here

and finally the small print ..

When the service pack is actually released you’ll have to uninstall and re-install the actual service pack because as usual with any Microsoft beta, CTP or RC code this won’t be a supported upgrade path.

Technorati Tags: hyper-v,windows server 2008 sp1,dynamic memory,virtualisation