Dynamic Memory is a welcome addition to Microsoft Hyper-V R2 Service Pack 1 (SP1), promising improved virtual memory allocation and increased virtual machine-to-host ratios. But as with any new feature, vendor support policies -- such as application memory requirements -- can limit the benefits.
Application vendors supply little guidance on optimizing custom applications for Hyper-V Dynamic Memory. But learning specific application memory requirements and understanding each app’s architecture will help you glean cost savings from Hyper-V Dynamic Memory.
By following these steps and answering a few questions about the application memory requirements you have to meet, you’ll learn how to best use Hyper-V Dynamic Memory in your infrastructure.
Find the true application memory requirements
Many vendors overstate their application memory requirements. They may be hoping to make extra money through hardware bundling, or they may simply want to make extra sure that their applications will be successful in your infrastructure.
But the app’s success is also your organization’s goal, and you have the added requirement of keeping costs down. Conservative resource management is even more relevant in shared-resource virtual infrastructures.
Getting the true application memory requirements will help you keep costs down. You can demo the software or work with a load-testing utility to determine the actual memory requirements, but there will still be some unknowns because it’s not in a production environment. Asking your vendor if you can talk with established customers is another good way to gage application memory requirements.
Set memory thresholds for the application
Once you have gathered the true application memory requirements, you can make corresponding changes to your virtual machine (VM) configurations. To set the memory requirements, follow these steps:
1. Shutdown the VM.
2. Right-click on the VM and choose Settings (Hyper-V Manager).
3. Click on Memory.
4. Choose the Dynamic radio button and set lower and upper memory limits.
5. Click OK
Know your application’s workload
You also need to understand the architecture of your applications, which will determine how you configure Hyper-V Dynamic Memory’s most important virtual memory settings: memory buffer and memory weight. Consider these questions for each application:
Does memory utilization stay consistent, with only occasional spikes?
This pattern of memory utilization is usually associated with batch-processing applications, and it’s the sweet spot for Hyper-V Dynamic Memory. To help meet your application memory requirements, Dynamic Memory can supply the amount that a VM needs regularly, then add more memory if the demand spikes. Similar to CPU, you’re basically betting that all your VMs will not spike their memory requirements at the same time. The total supply of memory probably wouldn’t be able to meet the increased needs of all VMs at once. But you should be aware of how often the demand for more memory spikes. If many VMs require large amounts of memory quickly, they could overrun the memory buffer, and performance could suffer.
The memory buffer is a percentage of RAM above what a VM currently utilizes, kept aside in case the VM needs more. By default, this amount is 20% greater than the amount currently allocated to the VM. For applications that expand quickly, however, you may need to experiment with this buffer to meet application memory needs during spikes in demand. In my experience, I have never had to move this setting above 35%.
Here’s what the memory buffer setting looks like:
Does the application request large amounts of memory during peak times?
A remote desktop or XenApp Server, for example, might request very large amounts of memory. Application memory requirements ramp up and remain high as users connect remotely and use applications throughout the day, but then drop dramatically after peak business hours. But watch out for the memory buffer: At the beginning of business hours, memory load could increase quickly, overrunning the added buffer. To create a balance, it’s a good idea to pair these types of workloads with those that have greater application memory requirements during non-peak hours.
Does the application load large amounts of data into memory?
These types of workloads -- typically databases -- load large amounts of data into memory to enhance their performance. Conserving memory with Hyper-V Dynamic Memory, therefore, may not be as relevant, because memory may expand to close to the maximum value. You may see memory levels drop during non-peak times, but this decrease will probably be minimal. For these types of workloads, you may be better off not using Hyper-V Dynamic Memory and setting memory statically.
Is the application critical, and what happens if there is not enough memory when requested?
The memory weight setting, a new option that came with Hyper-V SP1, can provide a safety net for the most critical applications. It’s similar to the CPU priority setting in that it allows you to tier VMs, so certain ones can request or obtain more memory before others. You can change the memory weight number for each VM, and the higher the number, the more critical the VM.
VMs with business-critical applications should have higher memory weight to ensure that the appropriate memory resources are always available.
Complete vendor support for features such as Hyper-V Dynamic Memory may never be fully realized, but if you know the application memory requirements and how the app uses memory, there is no reason why you can’t implement this feature. Be prepared for pushback from some uneducated vendors and assumed risk on your part, but if you want to maximize your virtualization investment, you should consider Hyper-V Dynamic Memory for all your workloads.