Jeff Alexander IT Pro Evangelist Microsoft Australia .

47
Dynamic Memory in Windows Server 2008 R2 SP1 Jeff Alexander IT Pro Evangelist Microsoft Australia http://blogs.technet.com/jeffa36

Transcript of Jeff Alexander IT Pro Evangelist Microsoft Australia .

Dynamic Memory in Windows Server 2008 R2 SP1Jeff AlexanderIT Pro EvangelistMicrosoft Australiahttp://blogs.technet.com/jeffa36

AgendaMemory Management & VirtualizationDynamic Memory

ConceptsArchitectureInternals

What about …VMWare?SQL and SQL-like workloads?

No one can size VMsHow 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 & MemoryMemory

Key factor to the number of running VMsPossibly most expensive asset in system

Customer RequirementsImprove density, with minimal performance impactMaintain consistent performanceDon’t provide a feature that’s unsuitable for production use

Dynamic Memory GoalsHigher VM consolidation ratios with minimal performance impact

Dependent on:How much variation in memory utilization the workloads haveHow good a job you did of sizing the systems in the first place

Work well for both server and desktop workloadsAdd minimal overhead to the systemPass the “that looks right” test

Adding/Removing MemoryAdding Memory

Enlightened fashionSynthetic Memory Driver (VSP/VSC Pair)

No hardware emulationLightweight

Removing MemoryWanted to remove memoryBallooning is more efficientMesses up task manager in the guest OS

Dynamic MemoryBenefits

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

T = 0 T = 15 T = 30 T = 0 T = 15 T = 30

2 GB

4 GB

6 GB

8 GB

Virtual MachinesMemory Settings

Total System MemoryMemory in Use by VMs

8 GB3 GB

Physical Memory Used37.5 %

3 VMs started

Finance VMSales VMEngineering VM

15 minutes later … work in progress

T = 0 T = 15 T = 30 T = 0 T = 15 T = 30

2 GB

4 GB

6 GB

8 GB

Virtual MachinesMemory Settings

Total System MemoryMemory in Use by VMs

8 GB6 GB

Physical Memory Used75 %

3 VMs started

Finance starts reportsEngineering starts ananalysis job

Finance VMSales VMEngineering VM

30 minutes later … working hard!

Memory recovered to allow Service VM

3 VMs started

Finance report finishedEngineering analysis runningIT starts a Service VM

Finance starts reportsEngineering starts ananalysis job

Engineering reaches max allocation

T = 0 T = 15 T = 30 T = 0 T = 15 T = 30

Virtual MachinesMemory Settings

Total System MemoryMemory in Use by VMs

8 GB7.5 GB

Physical Memory Used94 %

Finance VMSales VMEngineering VMService VM

2 GB

4 GB

6 GB

8 GB

System RequirementsParent Requirements:

Windows Server 2008 R2 SP1Microsoft Hyper-V Server 2008 R2 SP1

Supported Guests:Windows Server 2003, 2008 & 2008 R2

Enterprise and Datacenter Editions only32-bit & 64-bit versions

Windows Vista and Windows 7Enterprise and Ultimate Editions only32-bit & 64-bit versions

Dynamic Memory Architecture & Concepts

Memory Management & Virtualization

Cache to improve performanceWindows Memory Manager utilizes all free memory for cache

Dynamic Memory ConceptsMemory Demand:

Amount of memory VM needsAutomatically calculated SP1: “Total Committed Memory”

Memory Buffer:To satisfy cache needs for the VMSP1: “User Configuration”

Memory Buffer

Memory Deman

d

Dynamic Memory ConceptsSLAs

Startup MemoryMemory assigned during initial bootReserved memory for the VM

Maximum MemoryLimit memory for the VM

Target Memory“Just right” memory for the VM

Memory Buffer

Memory Deman

d

Maximum Memory

StartupMemory

TargetMemory

Dynamic Memory Architecture Guest Applications

Hypervisor

User Mode

KernelMode

DM VSC

VMWP

Windows

Memory

Manager VMBus

VMMS

VMBus

VID

WP Memory Manageme

nt

Windows Memory Manager

DM VDEV /

VSP

Memory Balancer Interface

Memory Balancer

Windows Memory Manager VID

Dynamic Memory VSCCollect / Send guest memory statistics to the balancerAdd / Remove memory to the guest

Enlightened Memory AdditionLightweight & fastNo 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 nodeShorter migration times

Dynamic Memory Components

VIDVirtualization Infrastructure DriverManages the mapping of VM memory => Physical MemoryUtilizing Windows Memory Manager to clean memoryUtilizing Windows Memory Manager to decrease fragmentation

Memory Balancer

Single place for all memory decisionsCalculates Memory DemandProtects 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 hostSLAT capability of the hostNUMA architecture of the host

~ 400 MB + (0.03 * Total Memory Size of the host)Optimally distributed across NUMA nodes

VM Reserve

Host Reserve

VM Overhea

dMemory Utilized by VMs

Memory BalancingWhen there is available memory on the host, VMs get their target memory

RootReserve

Memory Deman

d

BufferAvailabl

eMemory Memory

Demand

BufferTarget Memory

Target Memory

Memory BalancingWhen there is no available memory on the host, weight is used to determine memory distribution

RootReserve

Hyper-V Host

VM1Low

Weight

VM2Medium Weight

VM3High Weight

Memory Demand

Buffer

Memory Demand

Buffer

Memory Demand

BufferPriority Penalty

Priority Penalty Priority

Penalty

BufferBuffer

Target Memory

Target Memory

TargetMemory

When does DM balance memory?

Goal: Stable System / Minimal OverheadActive memory addition policy

Memory is added immediately when VM needs it

Passive memory reclamation policyMemory is not removed when there is no immediate needUnutilized memory is collected every 5 minutes

Availability & PriorityAvailability 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,000The higher the priority, the higher the availability

demo Dynamic Memory

System Impact

Changes to Parent ReserveHyper-V has always had the concept of a reserve of memory that is kept for the parent partitionDM allows VMs to push up against the reserve consistentlyNew behavior to better protect the parent partition from rampaging virtual machines

New registry key in placeMay result in less memory being available for VMs

VMWare vs 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

VMWare vs Hyper-V

VMWare vs Hyper-VMemory

backed by different

technologies

Memory backed by physical memory

VMMemory

2 GB

VMWare

Memory Buffer

Memory Demand

Maximum Memory

2 GB

Hyper-V

Memory always backed by physical memory

VMWare vs Hyper-VWhat about numbers?

Based on the configurationWhat 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%

VMWare vs Hyper-VVMWare:

Doesn’t trust guest information Users need to guess a memory sizeVMs start with large memory valuesThen memory is saved (!) with different technologies

Hyper-VCollaborates with guestAutomatic sizing of VMsMemory Thin Provisioning

What Next?

What's new Besides DM/RemoteFx Enhancements to scalability and high

availability when using DirectAccessaddition 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 CompatibilityTAP 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 VMsExchange 2010 Mailbox Role

Application CompatibilityWorkloads that require tuning =

Apps doing cache management (SQL / Java / …)

Memory Buffer = 5%App Minimum Memory < DM Startup MemoryApp Maximum memory < DM Maximum Memory

SQL Server & Dynamic MemoryOfficial 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

Static Memory

SQL Server & Dynamic Memory

Memory Buffer

Memory Deman

d

Host View Guest View

Free

SQL Server

Memory

Memory Buffer

Memory Deman

d

FreeFree

SQL Server

Memory

Windows Memory Manager

Low Resource Notification

Free

SQL Server

Memory

Memory Buffer

Memory Deman

d

Free

SQL Server

Memory

Free

SQL Server

Memory

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 [email protected]

ResourcesSQL and Dynamic Memory Configuration

http://blogs.msdn.com/b/sqlosteam/

Virtualization Team Bloghttp://blogs.technet.com/b/virtualization/

Dynamic Memory Configuration Guidehttp://technet.microsoft.com/en-us/library/ff817651(WS.10).aspx