470 likes | 480 Views
Learn about the concepts and architecture of Dynamic Memory in Windows Server 2008 R2 SP1. Discover how it enables higher VM consolidation ratios with minimal performance impact, and efficiently manages memory allocation for both server and desktop workloads.
E N D
Dynamic Memory in Windows Server 2008 R2 SP1 Jeff Alexander IT Pro Evangelist Microsoft Australia http://blogs.technet.com/jeffa36
Agenda • Memory Management & Virtualization • Dynamic Memory • Concepts • Architecture • Internals • What about… • VMWare? • SQL and SQL-like workloads?
Windows Server 2008 R2 SP1 RemoteFX Dynamic Memory
No one can size VMs • How much memory does an IIS server actually need? • Print server? • File server? • Branch Cache? • Direct Access? • How much will performance be affected if you halved the amount of memory in a VM?
No one wants to size VMs “New virtual machines get 1GB of RAM [no matter what the VM is running]. “All VMs get 4GB of RAM [I have no idea what is happening with that memory] and no one complains” “I take the minimum system requirements and add (insert one: 50%, 100%, 150%)” “A vendor tells me their app needs 4GB of RAM. I do not have the time to test this to find out if it is true or not”
Virtualization & Memory • Memory • Key factor to the number of running VMs • Possibly most expensive asset in system • Customer Requirements • Improve density, with minimal performance impact • Maintain consistent performance • Don’t provide a feature that’s unsuitable for production use
Dynamic Memory Goals • Higher VM consolidation ratios with minimal performance impact • Dependent on: • How much variation in memory utilization the workloads have • How good a job you did of sizing the systems in the first place • Work well for both server and desktop workloads • Add minimal overhead to the system • Pass the “that looks right” test
Adding/Removing Memory • Adding Memory • Enlightened fashion • Synthetic Memory Driver (VSP/VSC Pair) • No hardware emulation • Lightweight • Removing Memory • Wanted to remove memory • Ballooning is more efficient • Messes up task manager in the guest OS
Dynamic Memory • Benefits • Enables higher consolidation ratios per host by addressing the greatest limiting factor to consolidation: Memory • A Production feature. • Overview • Memory is pooled and dynamically and securely distributed across VMs • Memory is dynamically added/removed based VM usage with no service interruption • Guest enlightened: guests & Hyper-V work TOGETHER
Initial VM Start Finance VM 8 GB Sales VM Engineering VM 6 GB 4 GB 2 GB T = 0 T = 15 T = 30 T = 0 T = 15 T = 30 3 VMs started Total System Memory 8 GB Memory in Use by VMs 3 GB Physical Memory Used 37.5 % Virtual Machines Memory Settings
15 minutes later … work in progress Finance VM 8 GB Sales VM Finance starts reports Engineering starts ananalysis job Engineering VM 6 GB 4 GB 2 GB T = 0 T = 15 T = 30 T = 0 T = 15 T = 30 3 VMs started Total System Memory 8 GB Memory in Use by VMs 6 GB Physical Memory Used 75 % Virtual Machines Memory Settings
30 minutes later … working hard! Finance VM 8 GB Sales VM Finance starts reports Engineering starts ananalysis job Engineering VM Service VM 6 GB Engineering reaches max allocation 4 GB Finance report finished Engineering analysis running IT starts a Service VM 2 GB T = 0 T = 15 T = 30 T = 0 T = 15 T = 30 3 VMs started Memory recovered to allow Service VM Total System Memory 8 GB Memory in Use by VMs 7.5 GB Physical Memory Used 94 % Virtual Machines Memory Settings
System Requirements • Parent Requirements: • Windows Server 2008 R2 SP1 • Microsoft Hyper-V Server 2008 R2 SP1 • Supported Guests: • Windows Server 2003, 2008 & 2008 R2 • Enterprise and Datacenter Editions only • 32-bit & 64-bit versions • Windows Vista and Windows 7 • Enterprise and Ultimate Editions only • 32-bit & 64-bit versions
Memory Management & Virtualization • Cache to improve performance • Windows Memory Manager utilizes all free memory for cache
Dynamic Memory Concepts • Memory Demand: • Amount of memory VM needs • Automatically calculated • SP1: “Total Committed Memory” • Memory Buffer: • To satisfy cache needs for the VM • SP1: “User Configuration” Memory Buffer Memory Demand
Dynamic Memory Concepts • SLAs • Startup Memory • Memory assigned during initial boot • Reserved memory for the VM • Maximum Memory • Limit memory for the VM • Target Memory • “Just right” memory for the VM Maximum Memory Memory Buffer Target Memory Memory Demand Startup Memory
Dynamic Memory Architecture Guest Applications VMMS VMWP DM VDEV / VSP User Mode Memory Balancer Interface Memory Balancer WP Memory Management Kernel Mode Windows Memory Manager DM VSC Windows Memory Manager Windows Memory Manager VID VID VMBus VMBus Hypervisor
Dynamic Memory VSC • Collect / Send guest memory statistics to the balancer • Add / Remove memory to the guest • Enlightened Memory Addition • Lightweight & fast • No hardware emulation • Memory Removal by Ballooning
Worker Process Memory Management • Orchestrate all Hyper-V memory operations • Live Migration Optimization: • Shrink the memory of the VM on the source node • Shorter migration times
Dynamic Memory Components • VID • Virtualization Infrastructure Driver • Manages the mapping of VM memory => Physical Memory • Utilizing Windows Memory Manager to clean memory • Utilizing Windows Memory Manager to decrease fragmentation
Memory Balancer • Single place for all memory decisions • Calculates Memory Demand • Protects host from resource starvation • Ensures a stable system with minimal operations
Host Memory Reserve • Host Reserve is automatically calculated based on: • Total memory size of the host • SLAT capability of the host • NUMA architecture of the host • ~ 400 MB + (0.03 * Total Memory Size of the host) • Optimally distributed across NUMA nodes Host Reserve VM Overhead Memory Utilized by VMs VM Reserve
Memory Balancing • When there is available memory on the host, VMs get their target memory Target Memory Buffer Target Memory Available Memory Buffer Memory Demand Memory Demand Root Reserve
Memory Balancing • When there is no available memory on the host, weight is used to determine memory distribution Target Memory Buffer Priority Penalty TargetMemory Target Memory Buffer Priority Penalty Buffer Priority Penalty Buffer Buffer Memory Demand Memory Demand Memory Demand Root Reserve VM2 Medium Weight Hyper-V Host VM1 Low Weight VM3 High Weight
When does DM balance memory? • Goal: Stable System / Minimal Overhead • Active memory addition policy • Memory is added immediately when VM needs it • Passive memory reclamation policy • Memory is not removed when there is no immediate need • Unutilized memory is collected every 5 minutes
Availability & Priority • Availability is a concept • How much memory does the VM have? • How much memory does the VM want? • The difference is the availability • Priority: which VM gets the memory first • 1-10,000: default is 5,000 • The higher the priority, the higher the availability
Dynamic Memory demo
Changes to Parent Reserve • Hyper-V has always had the concept of a reserve of memory that is kept for the parent partition • DM allows VMs to push up against the reserve consistently • New behavior to better protect the parent partition from rampaging virtual machines • New registry key in place • May result in less memory being available for VMs
VMWarevs Hyper-V What about?
Memory Over-Commit (?) • Memory Over-Commit (Technology) • General name for VMWare Memory Management Technologies • Memory Over-Commit (Resource) • Subscribing more memory to your VMs than the physical memory on the host • VMWare / Microsoft agree: • Memory Resource Over-Commit is a bad thing
VMWarevs Hyper-V 2 GB 2 GB Memory backed by different technologies VM Memory Maximum Memory Memory Buffer Memory backed by physical memory Memory always backed by physical memory Memory Demand VMWare Hyper-V
VMWarevs Hyper-V • What about numbers? • Based on the configuration • What matters is how much memory VM needs? • Login VSI VDI workload demand ~400 / 600 MB • Previous Memory Size = 1 GB; Saving 40% • Previous Memory Size = 2GB; Saving 75%
VMWarevs Hyper-V • VMWare: • Doesn’t trust guest information • Users need to guess a memory size • VMs start with large memory values • Then memory is saved (!) with different technologies • Hyper-V • Collaborates with guest • Automatic sizing of VMs • Memory Thin Provisioning
What's new Besides DM/RemoteFx • Enhancements to scalability and high availability when using DirectAccess • addition of support for 6to4 and ISATAP addresses when using DirectAccess in conjunction with Network Load Balancing (NLB) • Support for Managed Service Accounts (MSAs) in secure branch office scenarios • SP1 enables enhanced support for managed service accounts (MSAs) to be used on domain-member services located in perimeter networks
What's New Besides DM/RFx • Support for increased volume of authentication traffic on domain controllers connected to high-latency networks • SP1 allows for more granular control of the maximum number of possible concurrent connections to a domain controller
Applications? What about?
Application Compatibility • TAP program workload list: • SQL / AD / DNS / Print Server / File Server / IIS / LoB Apps / RDS / Win7 VDI / DA / DHCP / Exchange (Non-Mailbox Roles) / TMG 2010 / SPS 2010 / App-V / Med-V / OCS / FTP / WDS / … • TAP program workloads not utilizing DM: • Linux VMs • Exchange 2010 Mailbox Role
Application Compatibility • Workloads that require tuning = • Apps doing cache management (SQL / Java / …) • Memory Buffer = 5% • App Minimum Memory < DM Startup Memory • App Maximum memory < DM Maximum Memory
SQL Server & Dynamic Memory • Official SQL Server Statement: Q7: Is Hyper-V Dynamic Memory supported for SQL Server? A7: Hyper-V Dynamic Memory is fully supported with SQL Server. Only SQL Server versions and editions (Enterprise and Datacenter) that support Hot Add Memory can see memory that is added by using Hyper-V Dynamic Memory. SQL Server versions that do not support Hot Add Memory are still supported. But these versions will detect only the memory that is present in the operating system when SQL Server starts. Before you deploy Hyper-V Dynamic Memory, please read the following resources when you use Hyper-V Dynamic Memory with SQL Server: Hyper-V Dynamic Memory Evaluation Guide SQLOS Team Blog - Hyper-V Dynamic Memory Windows Virtualization Team Blog - Dynamic Memory
SQL Server & Dynamic Memory Static Memory Free Free Windows Memory Manager Low Resource Notification SQL Server Memory Free Memory Buffer Memory Demand Free SQL Server Memory Free Memory Buffer Memory Demand SQL Server Memory SQL Server Memory Free Memory Buffer Memory Demand SQL Server Memory Host View Guest View
Microsoft Virtual Academy Why Enroll, other than it being free? The Microsoft Virtual Academy helps you to improve your IT skill set and advance your career with a free, easy to access training portal that allows you to learn at your own pace, focusing on Microsoft technologies. • What Do I get for enrolment? • Free training to make you become the Cloud-Hero in my Organization • Help mastering your Training Path and get the recognition • Connect with other IT Pros and discuss The Cloud Where do I Enrol? www.microsoftvirtualacademy.com Then tell us what you think. TellTheDean@microsoft.com
Resources • SQL and Dynamic Memory Configuration • http://blogs.msdn.com/b/sqlosteam/ • Virtualization Team Blog • http://blogs.technet.com/b/virtualization/ • Dynamic Memory Configuration Guide • http://technet.microsoft.com/en-us/library/ff817651(WS.10).aspx