SlideShare a Scribd company logo
1 of 23
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

Viewers also liked

Hcad competencies booklet (2) (1)
Hcad competencies booklet (2) (1)Hcad competencies booklet (2) (1)
Hcad competencies booklet (2) (1)
Ngonde
 
Niche Credentials Dec 2015
Niche Credentials Dec 2015Niche Credentials Dec 2015
Niche Credentials Dec 2015
Zoheb Deshmukh
 
CyberScope - 2015 Market Review
CyberScope - 2015 Market ReviewCyberScope - 2015 Market Review
CyberScope - 2015 Market Review
resultsig
 
Mastering PowerShell
Mastering PowerShellMastering PowerShell
Mastering PowerShell
Fahad Noaman
 
About the authors
About the authorsAbout the authors
About the authors
butest
 

Viewers also liked (17)

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

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

Oracle performance project public
Oracle performance project publicOracle performance project public
Oracle performance project public
Carlos Oliveira
 
Building perfect sql servers, every time -oops
Building perfect sql servers, every time -oopsBuilding perfect sql servers, every time -oops
Building perfect sql servers, every time -oops
Joseph D'Antoni
 
EM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance PagesEM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance Pages
Enkitec
 

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

1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
 
Presentation cloud control enterprise manager 12c
Presentation   cloud control enterprise manager 12cPresentation   cloud control enterprise manager 12c
Presentation cloud control enterprise manager 12c
 
Using Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource UtilizationUsing Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource Utilization
 
Findfixandvalidate 140221013443-phpapp01
Findfixandvalidate 140221013443-phpapp01Findfixandvalidate 140221013443-phpapp01
Findfixandvalidate 140221013443-phpapp01
 
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
 
Taming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI OptionsTaming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI Options
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Oracle performance project public
Oracle performance project publicOracle performance project public
Oracle performance project public
 
Adding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance TestAdding Value in the Cloud with Performance Test
Adding Value in the Cloud with Performance Test
 
SharePoint Databases: What you need to know (201504)
SharePoint Databases: What you need to know (201504)SharePoint Databases: What you need to know (201504)
SharePoint Databases: What you need to know (201504)
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
Lecture 9: Dynamic web application
Lecture 9: Dynamic web applicationLecture 9: Dynamic web application
Lecture 9: Dynamic web application
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of view
 
SQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachSQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and Approach
 
Building perfect sql servers, every time -oops
Building perfect sql servers, every time -oopsBuilding perfect sql servers, every time -oops
Building perfect sql servers, every time -oops
 
Road to database automation - Database source control
Road to database automation - Database source controlRoad to database automation - Database source control
Road to database automation - Database source control
 
EM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance PagesEM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance Pages
 
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
Sql Server Tuning for SharePoint : what every consultant must know (Office 36...
 
July webinar l How to Handle the Holiday Retail Rush with Agile Performance T...
July webinar l How to Handle the Holiday Retail Rush with Agile Performance T...July webinar l How to Handle the Holiday Retail Rush with Agile Performance T...
July webinar l How to Handle the Holiday Retail Rush with Agile Performance T...
 
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The SequelVMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
VMworld Europe 2014: Virtualizing Databases Doing IT Right – The Sequel
 

More from IDERA Software

Idera live 2021: The Power of Abstraction by Steve Hoberman
Idera live 2021:  The Power of Abstraction by Steve HobermanIdera live 2021:  The Power of Abstraction by Steve Hoberman
Idera live 2021: The Power of Abstraction by Steve Hoberman
IDERA Software
 
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...Idera live 2021:  Keynote Presentation The Future of Data is The Data Cloud b...
Idera live 2021: Keynote Presentation The Future of Data is The Data Cloud b...
IDERA Software
 
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...Idera live 2021:  Database Auditing - on-Premises and in the Cloud by Craig M...
Idera live 2021: Database Auditing - on-Premises and in the Cloud by Craig M...
IDERA Software
 

More from IDERA Software (20)

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

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

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

  1. 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
  2. Classifier function - Return workload name (sysname) Collation sensitive workload name Error assigns DEFAULT group Can’t assign INTERNAL group Must be schema-bound
  3. 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
  4. 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.
  5. 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.