SlideShare a Scribd company logo
Dealing with
Bad Roommates
SQL Server Resource Governor
Joey D’Antoni
20 July 2015
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
Agenda
The Problems with sharing your SQL Servers
An Introduction to Resource Governor
How to Implement Resource Governor
Demo
Bad Roomates
Bad Roommates in SQL Server
Is this your SQL
Server?
Or is this your SQL Server?
Other Applications
Poll Question
Tell us about your SQL Server environment…
Resource Management < SQL
2008
SQL Server
Memory, CPU, Threads
Resources
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)
Why Use Resource Governor?
Prioritization
between apps
and users
Limit runaway
queries
Give control
back to the
DBA
Resource Governor Concepts
Resource Pool
Manages server resources
Workload Group
Aggregates similar session requests
Classifier Function
Classifies connection to its workload group
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
Admin
Workload
OLTP
Workload
Report
Workload
Importance
Workloads have importance labels
• Low
• Medium
• High
Adjusts relative importance to
workloads for resource allocation
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
Poll Question:
Have you used
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
Resource Governor Overview
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
Demo
Implementing
and Using
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_volumes
Use Cases
SQL Server
Consolidation
Servers with mixed
OLTP and Reporting
Workloads
Using SharePoint and
Dynamics with other
databases
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
Questions

More Related Content

PDF
Breaking data
PDF
JavaEE and RESTful development - WSO2 Colombo Meetup
PDF
Implementing sql server always on
PDF
Road to database automation: database source control
PPTX
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
PPTX
Always on in SQL Server 2012
PPTX
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...
PDF
Java colombo-deep-dive-into-jax-rs
Breaking data
JavaEE and RESTful development - WSO2 Colombo Meetup
Implementing sql server always on
Road to database automation: database source control
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
Always on in SQL Server 2012
High Availability & Disaster Recovery with SQL Server 2012 AlwaysOn Availabil...
Java colombo-deep-dive-into-jax-rs

Viewers also liked (17)

PDF
Hcad competencies booklet (2) (1)
PPT
Searching for Users: SEO as an Engine for Customer Acquisition (Stephan Spenc...
PPT
02 linux desktop usage
PDF
The Tux 3 Linux Filesystem
PDF
Application Acceleration: Faster Performance for End Users
PPTX
Niche Credentials Dec 2015
PPTX
CyberScope - 2015 Market Review
PDF
5 Winning Strategies - Social Ecommerce Ebook
PPS
Dit Was 2008 Sofie Van Hoof
PPTX
Geek Sync | Avoid Corruption Nightmares within your Virtual Database
PDF
Mabula spa brochure
PDF
Mastering PowerShell
PDF
Geek Sync I Consolidating Indexes in SQL Server
PPTX
Employee Engagement: Fluffy Nonsense or Mission Critical?
PPT
03 browsing the filesystem
DOC
About the authors
PDF
Infographic: The Accidental DBA
Hcad competencies booklet (2) (1)
Searching for Users: SEO as an Engine for Customer Acquisition (Stephan Spenc...
02 linux desktop usage
The Tux 3 Linux Filesystem
Application Acceleration: Faster Performance for End Users
Niche Credentials Dec 2015
CyberScope - 2015 Market Review
5 Winning Strategies - Social Ecommerce Ebook
Dit Was 2008 Sofie Van Hoof
Geek Sync | Avoid Corruption Nightmares within your Virtual Database
Mabula spa brochure
Mastering PowerShell
Geek Sync I Consolidating Indexes in SQL Server
Employee Engagement: Fluffy Nonsense or Mission Critical?
03 browsing the filesystem
About the authors
Infographic: The Accidental DBA
Ad

Similar to Geek Sync I Dealing with Bad Roommates - SQL Server Resource Governor (20)

PPTX
Using Resource Governor to Control Resource Utilization
PPT
resource governor
PDF
Workload Management in SQL Server 2019
PPTX
Building perfect sql servers, every time -oops
PPTX
Investigate SQL Server Memory Like Sherlock Holmes
PDF
Introduction to SQL Server Security
PDF
PPTX
Performance Eye for the SQL Guy
PDF
Lesson 1 configuring
PDF
Configuring sql server - SQL Saturday, Athens Oct 2014
PPTX
Vld bs conquering the giant
PPT
Les 16 resource
PDF
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
PDF
Running SQL 2005? It’s time to migrate to SQL 2014!
PPTX
SQL-Server-Features-Empowering-Database-Management1.pptx
PPT
Fortress SQL Server
PPTX
Minding SQL Server Memory
PDF
Performance tuning in sql server
PDF
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
PPTX
JSSUG: SQL Sever Performance Tuning
Using Resource Governor to Control Resource Utilization
resource governor
Workload Management in SQL Server 2019
Building perfect sql servers, every time -oops
Investigate SQL Server Memory Like Sherlock Holmes
Introduction to SQL Server Security
Performance Eye for the SQL Guy
Lesson 1 configuring
Configuring sql server - SQL Saturday, Athens Oct 2014
Vld bs conquering the giant
Les 16 resource
10 Deadly Sins of SQL Server Configuration - APPSEC CALIFORNIA 2015
Running SQL 2005? It’s time to migrate to SQL 2014!
SQL-Server-Features-Empowering-Database-Management1.pptx
Fortress SQL Server
Minding SQL Server Memory
Performance tuning in sql server
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
JSSUG: SQL Sever Performance Tuning
Ad

More from IDERA Software (20)

PPTX
The role of the database administrator (DBA) in 2020: Changes, challenges, an...
PPTX
Problems and solutions for migrating databases to the cloud
PPTX
Public cloud uses and limitations
PPTX
Optimize the performance, cost, and value of databases.pptx
PPTX
Monitor cloud database with SQL Diagnostic Manager for SQL Server
PPTX
Database administrators (dbas) face increasing pressure to monitor databases
PPTX
Six tips for cutting sql server licensing costs
PDF
Idera live 2021: The Power of Abstraction by Steve Hoberman
PDF
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
PDF
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
PDF
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
PDF
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
PDF
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
PDF
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
PDF
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
PPTX
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
PPTX
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
PPTX
Benefits of Third Party Tools for MySQL | IDERA
PPTX
Achieve More with Less Resources | IDERA
PPTX
Benefits of SQL Server 2017 and 2019 | IDERA
The role of the database administrator (DBA) in 2020: Changes, challenges, an...
Problems and solutions for migrating databases to the cloud
Public cloud uses and limitations
Optimize the performance, cost, and value of databases.pptx
Monitor cloud database with SQL Diagnostic Manager for SQL Server
Database administrators (dbas) face increasing pressure to monitor databases
Six tips for cutting sql server licensing costs
Idera live 2021: The Power of Abstraction by Steve Hoberman
Idera live 2021: Why Data Lakes are Critical for AI, ML, and IoT By Brian Flug
Idera live 2021: Will Data Vault add Value to Your Data Warehouse? 3 Signs th...
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021: Managing Databases in the Cloud - the First Step, a Succes...
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021: Performance Tuning Azure SQL Database by Monica Rathbun
Geek Sync | How to Be the DBA When You Don't Have a DBA - Eric Cobb | IDERA
How Users of a Performance Monitoring Tool Can Benefit from an Inventory Mana...
Benefits of Third Party Tools for MySQL | IDERA
Achieve More with Less Resources | IDERA
Benefits of SQL Server 2017 and 2019 | IDERA

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
Machine learning based COVID-19 study performance prediction
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
Machine learning based COVID-19 study performance prediction
MIND Revenue Release Quarter 2 2025 Press Release

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

  • 1. Dealing with Bad Roommates SQL Server Resource Governor Joey D’Antoni 20 July 2015
  • 2. 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
  • 3. Agenda The Problems with sharing your SQL Servers An Introduction to Resource Governor How to Implement Resource Governor Demo
  • 5. Bad Roommates in SQL Server Is this your SQL Server? Or is this your SQL Server?
  • 7. Poll Question Tell us about your SQL Server environment…
  • 8. Resource Management < SQL 2008 SQL Server Memory, CPU, Threads Resources
  • 9. 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)
  • 10. Why Use Resource Governor? Prioritization between apps and users Limit runaway queries Give control back to the DBA
  • 11. Resource Governor Concepts Resource Pool Manages server resources Workload Group Aggregates similar session requests Classifier Function Classifies connection to its workload group
  • 12. 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 Admin Workload OLTP Workload Report Workload
  • 13. Importance Workloads have importance labels • Low • Medium • High Adjusts relative importance to workloads for resource allocation
  • 14. 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
  • 15. Poll Question: Have you used resource governor?
  • 16. 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
  • 18. 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
  • 20. 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_volumes
  • 21. Use Cases SQL Server Consolidation Servers with mixed OLTP and Reporting Workloads Using SharePoint and Dynamics with other databases
  • 22. 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

Editor's Notes

  • #9: What we did before to control resource usage was inflexible and largely reactive: Kill SPIDs with “runaway” queries utilize SET QUERY_GOVERNOR_COST_LIMIT per query (or per instance with sp_configure) use separate instances with affinity to separate workloads juggle scheduled jobs to avoid peak activity times schedule creation / destruction of procedures or even changing passwords to block certain groups during peak load times
  • #12: Classifier function - Return workload name (sysname) Collation sensitive workload name Error assigns DEFAULT group Can’t assign INTERNAL group Must be schema-bound
  • #13: xA bucket of “similar” requests (as determined by you). Thing to that your connection has been assigned to after it has been classified. If classifier function does not work, default pool DDL Internal Tasks (Lazy-writer, checkpoint, ghost cleanup) run under internal group. It can pressurize everything else. Default Group has no limit but can get pressurize by everything else. Max Requests. One pool : many groups (no limit) Controls: Importance  (Low, Normal, High) Max Concurrent Requests Request Max CPU Time Seconds Request Max Memory Grant Percent Request Max Memory Grant Timeout Request MAX DOP
  • #15: Please note: Amount of Memory is not what you might think. Its amount of “query execution memory” given to that connection. Its NOT total amount of Server Memory. So you could have a connection that reads a lot of data and uses buffer pool. It doesn’t count of Plan Cache and Bpool. Default and Internal CPU: Amount of CPU is for per scheduler. NOTE:::: If there is no contention you would not see throttling. RG kicks in when there is a need.
  • #19: The internal pool represents the resources consumed by the SQL Server itself. This pool always contains only the internal group, and the pool is not alterable in any way. Resource consumption by the internal pool is not restricted. Any workloads in the pool are considered critical for server function, and Resource Governor allows the internal pool to pressure other pools even if it means the violation of limits set for the other pools. In some cases, Resource Governor will act differently than how it is set up. Let’s look at a few of these cases. No resource contention. Although you have set up some limitation to the resources for a particular pool, you might find cases when the limits are not taken into account. Consider a scenario where you have set up a pool with a CPU cap of 25%. If at the time of executing a task in that pool there are no other active or workable SPIDS in other pools, this cap will not be taken into account. Importance. Let’s say you have two tasks: Task A with importance of HIGH, and Task B with importance of LOW. These settings do not mean that Task A will execute first, and then Task B will be executed. Importance is nothing but a numeric weight given to a request. What the importance settings actually do is to tell the scheduler to give 3 out of 4 units of work to Task A and the other one part to Task B. Both tasks can execute simultaneously. Waiting or pre-emptive state. If a query is waiting for other resources such as I/O, another query that has a cap set might use all available resources even though the first task is still active. That is because Resource Governor does not recognize a task that is in a WAITING for resource mode. Off-limit requests. There are quite a few requests that are off limits to Resource Governor. Extended stored procedures, for example, are usually off limits, including Database Mail, linked server queries, and COM/OLE automation.