Top Banner
Dealing with Bad Roomates SQL Server Resource Governor Joey D’Antoni 20 July 2015
23

Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Aug 12, 2015

Download

Technology

Idera Software
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Dealing with Bad RoomatesSQL Server Resource Governor

Joey D’Antoni

20 July 2015

Page 2: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Joey D’Antoni

• Joey has over 15 years of experience with a wide variety of data platforms, in both Fortune 50 companies as well as smaller organizations

• He is a frequent speaker on database administration, big data, and career management

• He is the co-president of the Philadelphia SQL Server User’s Group• MSCE, Business Intelligence, Data Platform• He wants you to make sure you can restore your data

Joeydantoni.com

Page 3: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Agenda

The Problems with sharing your SQL Servers

An Introduction to Resource Governor

How to Implement Resource Governor

Demo

Page 4: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Bad Roomates

Page 5: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Bad Roommates in SQL Server

Is this your SQL Server?

Or is this your SQL Server?

Page 6: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Other Applications

Page 7: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Poll Question

Tell us about your SQL Server environment…

Page 8: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Resource Management < SQL 2008

SQL Server

Memory, CPU, Threads

Resources

Page 9: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Introducing Resource Governor

Introduced in SQL Server 2008

Enterprise Edition Only

Controls CPU and Memory Resources (2008-2012)Controls CPU, IOPs, and Memory Resources (2014)

Page 10: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Why Use Resource Governor?

Prioritization between apps and

users

Limit runaway queries

Give control back to the

DBA

Page 11: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Resource Governor Concepts

Resource Pool

Manages server resources

Workload GroupAggregates similar session requests

Classifier FunctionClassifies connection to its workload group

Page 12: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Resource Governor Workloads

Split Workloads• Application Name• Login • Not Database

Per Request Limits• Max Memory %• Max CPU Time• Grant Timeout

Resource Monitoring

SQL Server

Memory, CPU, Threads

Resources

AdminWorkload

OLTPWorkload

ReportWorkload

Page 13: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Importance

Workloads have importance labels

• Low• Medium• High

Adjusts relative importance to workloads for resource allocation

Page 14: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Resource Governor Pools

Resource Pool: A subset of database resources

Controls• Minimum CPU %• Maximum CPU % • Minimum Memory %• Maximum Memory %

Workload Group Controls• Importance• Maximum Requests• CPU Time (sec)• Memory Grant %• Grant Time Out• MaxDOP• Min and Max IOPS Per Volume

Page 15: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Poll Question:

Have you used resource governor?

Page 16: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Classifier Function

User defined scalar function to classify incoming connections to resource group

One per instance

Does not apply to internal workload group

Evaluated for every new connection

Should be in master database

If no function all connections go to default group

Page 17: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Resource Governor Overview

Page 18: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Limitations

Internal Pool always wins

Default Pool is always there

No resource contention=no resource governing

Importance is only weight

Does not recognize waiting tasks

No TempDB limits

Page 19: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Demo

Implementing and Using Resource Governor

Page 20: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Monitoring Resource Governor

Metadata CVs:• sys.resource_governor_resource_pools• sys.resource_governor_workload_groups• sys.resource_governor_configuration

Running value DMVs:• sys.dm_resource_governor_resource_pools• sys.dm_resource_governor_workload_groups• sys.dm_resource_governor_resource_pool_volu

mes

Page 21: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Use Cases

SQL Server Consolidation

Servers with mixed OLTP and Reporting

Workloads

Using SharePoint and Dynamics with other

databases

Page 22: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Other Limitations

Database Engine Only—Nothing for SSAS, SSRS,

SSIS

Limit of 18 user-defined resource

pools

Many components

(Database Mail, linked server

queries, XPs) are not subject to

resource governor

No IO throttling until SQL 2014

Page 23: Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor

Questions