Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan...

35
Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy Bowerman Madhan Arumugam [email protected] [email protected] DBI208

Transcript of Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan...

Page 1: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Get More out of SQL Server 2012 in the Microsoft Private Cloud environment

Guy Bowerman Madhan [email protected]@microsoft.com

DBI208

Page 2: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Madhan Arumugam

Lead Program ManagerAreas: SQL Server Memory Management, scale up, virtualization/consolidationBefore MS: Software Engineer at Intel Corp, Cache coherencyGrew up in India, currently based at Redmond, USA

Guy Bowerman

Senior Program ManagerAreas: SQL Server and SQL Azure Multi-tenancy, SQLOS, VirtualizationBefore MS: Cloud/Virtualization Architect at IBM (Informix)Grew up in UK, currently based at Redmond, USA

Page 3: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

What you’ll get out of this session

Understand SQL Server 2012 capabilities for Private cloudLearn about the best practices to optimize SQL 2012 in Private cloud deploymentsInformation about SQL Server 2012 Licensing for private cloud

Page 4: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Journey to cloud

Low Control

Shar

edLo

wer

cos

tD

edic

ated

Hig

her c

ost

High Control

Hybrid Cloud

Physical

Virtual

PaaS

SaaS

IaaS

On premises

Off premises

Private cloud. The cloud infrastructure is operated solely for an organization. It may be managed by the organization or a third party and may exist on premise or off premise.

Page 5: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Journey to cloud - SQL Server Cloud Continuum

Low Control

Shar

edLo

wer

cos

tD

edic

ated

Hig

her c

ost

High Control

100% Compatibility Rapid self-service provisioning

SQL Server in WA VM - IaaS Virtualized Machine

SQL Server Physical Machine (raw iron)

Full h/w controlRoll-your-own HA/DR/scale

Managed database serviceFocus on business logic

Virtualized DatabaseWA SQL Database - PaaS

Elastic/Self-Service capabilities Full h/w control

SQL Server Private Cloud - IaaS Virtualized Machine

Page 6: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Fastest Time to Solution

Good Better Best

Performance at Scale

Component Flexibility

Fastest Time to Solution

Good Better Best

Performance at Scale

Component Flexibility

Fastest Time to Solution

Good Better Best

Performance at Scale

Component Flexibility

Self-Build Reference Architecture Appliance

Private Cloud – Deployment options

Private Cloud Reference Architecture http://social.technet.microsoft.com/wiki/contents/articles/4346.private-cloud-principles-patterns-and-concepts.aspx

Page 7: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Private Cloud - Deployment patterns

Self-ServiceVM TemplatesVM-level HA

Centralized IT ServicesCentrally managed databasesLarge VMsApp level HA

Optimize for Uptime Optimize for Time to Solution

Page 8: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Private Cloud – what and why

Page 9: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Server 2012 capabilities to improve efficiency

• Support for Dynamic Memory

• RDBMS Memory management

• Scale up

Page 10: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Support for Dynamic Memory

Hyper-V feature - Dynamically assign memory to VMs based on current need

Additional memory appears as Hot-Add memory to guest OSUses Ballooning when taking away memory

Virtual device driver in guest VM allocates memory and returns it to host

Decreases VM configuration complexity and Improve Elasticity SQL Support

SQL 2005-2008 R2 SQL Server 2012

32-bit requires –h startup option & AWE enabled

64-Bit Support Only

Great for Self Service pattern

SKU Dynamic Memory

Express -

Workgroup -

Standard -

Enterprise

SKU Dynamic Memory

Express -

Web (SPLA)/VM

Standard/VM

Enterprise

Page 11: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

demo

SQL Server 2012 with Hyper-V Dynamic Memory

Page 12: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL/Dynamic Memory GuidelinesHyper-V / VMM DM Params

Recommendations

Startup RAM 1GB + SQL Min Server Memory (if set)In unplanned failover scenariosthe total amount of Startup Memory combined (both local to the host and virtual machines to be failed over) should be lower than the total physical memory minus the host reserve memory

Maximum RAM >SQL Max Server Memory (if set)

• Leave SQL max server memory setting to default; If live migrating SQL/VMs, use max server memory to reduce SQL memory consumption prior to migration

• If using Dynamic memory, configure SQL to use Lock pages in memory• Perf counters to monitor:

• SQL Server: Memory Manager -Database Cache Memory (KB), Free Memory (KB), Total Server Memory (KB), Buffer Manager\Page Writes/sec + Page Reads/sec. Hyper-V Dynamic Memory Balancer – Available Memory, Hyper-V Dynamic Memory VM – Physical Memory (for each VM)

Running SQL Server with Hyper-V Dynamic Memory - http://msdn.microsoft.com/en-us/library/hh372970.aspx

Page 13: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

RDBMS Memory managementMemory manager re-architected to improve performance/scale and easier capacity planning. ‘Max server memory’ a more precise sizing mechanism

OS

Bufferpool (8K allocations)

CLR, DWA, TS, >8K allocations

OS

All size page allocations + CLR

DWA, TS

Mem

ory

allo

cati

ons

wit

hin

sq

lserv

r pro

cess

space

Mem

ory

allo

cati

ons

wit

hin

sq

lserv

r pro

cess

space

Max s

erv

er

mem

ory

DWA – Direct Windows Allocations TS- Thread stacks

Max s

erv

er

mem

ory

SQL 2008 R2 and before SQL 2012

Page 14: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Best Practices sizing SQL (updated for SQL 2012)

‘max server memory’ Can be set on dedicated server/VM. Leave enough room for OS and SQL worker thread stacks (2MB on x64)Also set if you are running multiple SQL instances in a large VMNeeds to be set if using large page model (T834)

‘min server memory’ can be set to guarantee some necessary amount of memory, or to essentially make the memory model static

Pay attention to virtual NUMA in Windows Server 2012 and affinitize cores along the vNUMA boundaries for best performance

Page 15: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Scale upSQL Scale up on Win Server 2012

Native Support for 640 logical processors and 4TB RAM SQL Virtualization on Win Server 2012 Hyper V

Great for centralized IT

services pattern

> 1 million IOPS from a single VM

Page 16: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Server 2012 Multi-tenancy capabilities

Resource Governor: 64 Resource Pools (up from 20)• Multi-tenant Isolation • Increase application density

Resource Governor: Max cap on CPU usage• Predictable CPU usage for chargeback• Isolation from system tasks

Resource Governor resource pool affinity• Simple partitioning of physical resources• Predictable resource allocation

Great for centralized IT

services pattern

Page 17: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Resource Governor overview

Classification

DefaultGroup

Group 2Group 1 Group 2Group N…

Attributes

UDF

Pool 1Internal pool Pool 62 Default pool

Requests

Background tasks, DAC

connections

Page 18: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

demo

Resource Governor in SQL Server 2012

Page 19: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Multi-tenancy best practicesUse Resource Governor within larger VMs Create VM templates that represent a balanced resource configuration (small, medium, large)Know your SQL workload profile before deciding to overcommit a particular resource dimension (CPU, memory, IOPS)Most often investing in more physical memory and giving more RAM per VM gives you the best ROISequential IO within VM may end up being random IO at host level, so optimize IO subsystem for Random IODisk placement less important for consolidated storage Use dynamic VHD unless constrained by I/O subsystem

Page 20: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Server 2012 HADR capabilities

Always On• Multiple Active Secondaries Improves utilization by

offloading read/maintenance work (backup)• Much more performant than DBM• Availability Groups : Application centric multiDB HADR

over non shared storage with faster/reliable application recovery

Improvement HW/SW Recoverability• Geo Cluster Multi-subnet Support enables DR• sp_server diagnostics : comprehensive SQL

health status• Hardware Memory scrubber support

Great for centralized IT

services pattern

Page 21: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL 2012 AlwaysOn HA/DRCareGroup Healthcare Systems

Sync

ASync

Windows 2008 R2 Hosts Cluster

Windows 2008 R2 Guest Cluster

Availability Group: BillingSys

Pri

mary

Sit

eD

R S

ite

Denali_A Denali_B

Denali_C

Pri

mar

y

Hyper-VNode BHyper-V

Node A

Node C

Extreme High

Availability

HW & OS Failure ProtectionOS & SQL Failure ProtectionDisk & DB Failure Protection

Page 22: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Hyper-V Live Migration

Windows 2008 R2 Host Cluster

Memory SyncConfiguration DataMemory Content

CSV

Denali_A

Denali_B

Denali_A

User still

connected

without

interruption

Sync Availability Group: BillingSys

Sync AG: BillingSys

Denali_A

Hyper-VNode B

Hyper-VNode A

Denali_B VHD (in Cluster Shared Volume)

Denali_A VHD (in Cluster Shared Volume)

Page 23: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL HADR Best Practices

Use highly available VM in Hyper-V to make HA built-in for self-service patternAlwaysOn Availability Groups (AG), together with host clustering and guest clustering provides extreme HAAlwaysOn AG for unplanned failoverLive migration for planned failover

Live migration enhancements in Win8

Page 24: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

sp_server_diagnosticsCaptures diagnostic data and health information about SQL Server service to detect potential failures after analyzing internal system stateReliable when nothing else is working

0 – No Automatic Failover or restart

Service is down

1 – Failover or restart on server down

No response from SP

2 – Failover or restart on server unresponsive

System errors3 – Failover or restart on critical

SQL Server errors

Resource errors4 – Failover or restart on

moderate SQL Server errors

Query errors5 – Failover or restart on any qualified failure conditions

Log only

Page 25: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Server 2012 Automation capabilities

PowerShell 2.0 support Additions to the SQL Server Provider

AlwaysOn High Availability objects Analysis Services support (AMO) Integration Services support Xevents support

New Scenario Cmdlets AlwaysOn High Availability cmdlets Analysis Services cmdlets Reporting Services Sharepoint mode

cmdlets

Page 26: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

demo

SQL Server Automation with PowerShell cmdlets

Page 27: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Server 2012 licensing for Virtualized environment

SQL Server 2012 licensing guide http://www.microsoft.com/sqlserver/en/us/editions.aspx

Page 28: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

SQL Server Private cloud case studies

Page 29: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Drive Green IT:

in the first year

REDUCE COST

35% ENERGY

90%COOLING

95%

FLOOR SPACE

89%ADMINISTRATION

75%

100-200 VMs 200-400 VMs Hundreds of VMs Thousands of VMs

Microsoft Private Cloud Database ApplianceReduce TCO and SCALE TO 1000’s of Databases

Page 30: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Road ahead

Windows Server 2012 Virtualization enhancements further unlocks the potential of SQL Server 2012 private cloud

Virtual Fiber channel within VMParallel Live migration, Storage migrationStorage spaces, SMB fileshare and scores of enhancementsOffload Data Transfer (ODX)Network virtualization

SQL Server in Windows Azure Virtual Machine – opens the doors to Hybrid IT Data platform

Don’t miss the session today at 1:00 PM (same room)

Page 32: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Resources

Connect. Share. Discuss.

http://europe.msteched.com

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Resources for Developers

http://microsoft.com/msdn

Page 33: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

Evaluations

http://europe.msteched.com/sessions

Submit your evals online

Page 34: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.
Page 35: Get More out of SQL Server 2012 in the Microsoft Private Cloud environment Guy BowermanMadhan Arumugam guybo@microsoft.commadhana@microsoft.com DBI208.

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

PRESENTATION.