Download presentation
Presentation is loading. Please wait.
Published byRainer Gerstle Modified over 6 years ago
1
Rock-Solid Performance with SQL Server 2008 Resource Governor
11/16/ :26 AM Rock-Solid Performance with SQL Server 2008 Resource Governor Riaan Vermeulen Eclipse Networks © 2009 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.
2
Session Objectives and Takeaways
11/16/2018 Session Objectives and Takeaways Why is the Resource Governor so important? How does it work? How and when should you use it? What have we learned? © 2008 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.
3
The history of things before...
...related to Hardware Resource issues Run-away queries on the server. Unpredictable workload execution. Client: “It ran just fine yesterday! Why is it so slow today?” DBA: “Okay, who else is using the system?” Client: “WELL JUST ABOUT EVERYONE! Who else?” Managing quality of service Client: “Oh and by the way, my report is the most important one!” Run-away queries on the server: * A resource intensive query can take up most or all of the server resources. Unpredictable workload execution: * Concurrent applications on the same server have workloads of different size and type. For example, two data warehouse applications or a mix of OLTP and data warehouse applications. These applications are not isolated from each other and the resulting resource contention causes unpredictable workload execution. Setting workload priority: * One workload is allowed to proceed faster than another or is guaranteed to complete if there is resource contention. Resource Governor enables you to assign a relative importance to workloads.
4
Quote “Having a method to control resource usage by applications allows you to consider consolidating SQL Server instances knowing you can control resources if necessary. Being able to control your machine resource when more than one application is placed on a single SQL Server machine, and running that machine closer to capacity, will allow your organization to reduce hardware and license costs associated with SQL Server ” – Gregory A. Larsen, DevX.com
5
Why is the Resource Governor so important?
Statement: It enables DBAs to manage SQL Server workload and critical system resource consumption Ponder moment! Puts you back in control of your resources If done properly, virtually eliminates resource contention (…related to hardware) QUESTION: So why is something like the Resource Governor so important? ANSWER: It enables DBAs to manage SQL Server workloads and critical system resource consumption IN OTHER WORDS!!! Puts you back in control of your resources Could potentially eliminate hardware resource contention
6
Let’s get serious for a moment!
Resource Governor provides: The ability to classify incoming connections and route their workloads to a specific group (with predefined resources). The ability to monitor resource usage for each workload in a group.
7
Let’s get serious for a moment!
2 Let’s get serious for a moment! Resource Governor provides: The ability to pool resources and set pool-specific limits on CPU usage and memory allocation. This prevents or minimizes the probability of run-away queries. The ability to associate grouped workloads with a specific pool of resources. The ability to identify and set priorities for workloads.
8
Resource Governor How does it work? Resource Pools Workload Group
Understanding The Concepts Resource Governor Resource Pools Workload Group Classification NEED TO UNDERSTAND THE THREE UNDERLYING CONCEPTS OF THE RESOURCE GOVERNOR CLASSIFICATIONS WORKLOAD GROUPS RESOURCE POOLS
9
The Concepts 1 Resource Pool Set create limits for resource usage.
Resource Governor Resource Pool Workload Group Classification Resource Pool Set create limits for resource usage. Applied only if other applications require the resources. Thus, MAX settings are only enforced when contention occurs E.g. If a pool has a max CPU of 10% and another at 90%, why can a query from pool1 exceed 10% CPU? RESOURCE POOL: The resource pool enables you to create limits for resource usage. These limits are applied if other applications require the resources. If no other applications are running, the limits are not applied CLASSIFICATIONS: Classification functions group applications into workload groups so that limits can then be applied to their resource usage
10
The Concepts 2 Resource Pool (Continued…)
Resource Governor Resource Pool Workload Group Classification Resource Pool (Continued…) Resource pool settings can be complex… Sum of all MINs cannot exceed 100% All resource pools guarantees their MIN setting Any resources left over are shared E.g. Two pools with MIN of 40% each leaves 20% to share E.g. Two pools with 50% each leaves nothing to share If the total of all pools’ MINs are 100%, then each pool’s MIN is also it’s MAX, regardless of the MAX setting The internal pool does not count in these calculations and can pressure other pools RESOURCE POOL: The resource pool enables you to create limits for resource usage. These limits are applied if other applications require the resources. If no other applications are running, the limits are not applied
11
The Concepts 3 Workload Groups
Resource Governor Resource Pool Workload Group Classification Workload Groups way of grouping together queries, tasks, user connections, etc E.g. batch processes, reports, executives, helpdesk, maintenance Assigned to a specific resource pool Internal tasks (e.g. checkpoint, ghost cleanup) always are part of the internal group There is a default group which cannot be changed and provides the behavior of no resource governor running (i.e. behavior of previous versions) WORKLOAD GROUP DEFINITION!!!! You can think about a workload group as a container or bucket for a set of similar queries or tasks, and the purpose of the group is to route requests in the group to a specific resource pool. The separation is there because, while with a resource pool you can control CPU and memory, adding a layer for workload groups allows you to add additional controls for different sets of requests across the same “slice” of the instance’s resources. For example, you might have a resource pool for the engineering department, but you might want to create a separate workload group for testers or quality assurance folks so they don’t inadvertently take too many resources, or for your boss so that his queries finish faster than yours (or vice versa).
12
The Concepts 4 Classification Functions
Resource Governor Resource Pool Workload Group Classification Classification Functions Classification functions group applications into workload groups so that limits can then be applied to their resource usage. Incoming connections are classified into workload groups using a T-SQL user-defined function Takes no parameters and returns group name as a sysname type Plenty of functions to use: HOST_NAME(), APP_NAME(), SUSER_NAME(), SUSER_SNAME(), IS_SRVROLEMEMBER(), and IS_MEMBER(). CLASSIFICATION DEFINITION!!!! Classification functions group applications into workload groups so that limits can then be applied to their resource usage Plenty of functions to use: HOST_NAME, APP_NAME, SUSER_NAME, IS_MEMBER, new CONNECTIONPROPERTY
13
Summary User connects Connection is:
Classified & Assigned to a workload group Workload group is already bound to a pool with limits Queries execute within the limits of the pool
14
In Practise Not Enabled by Default! 1 RESOURCE POOL:
The resource pool enables you to create limits for resource usage. These limits are applied if other applications require the resources. If no other applications are running, the limits are not applied CLASSIFICATIONS: Classification functions group applications into workload groups so that limits can then be applied to their resource usage
15
Configure Resource Governor
11/16/ :26 AM demo Configure Resource Governor © 2007 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.
16
Dynamic Control Simple syntax to start, stop, and make changes
ALTER RESOURCE GOVERNOR {DISABLE | RECONFIGURE} RECONFIGURE starts the governor if it’s currently disabled After a pool/group is created or altered, the changes can be immediately applied to the resource governor by issuing a RECONFIGURE statement Obviously pools and groups can’t be dropped it they are in use There may be a transition period if you lower available memory or CPU for a pool RESOURCE POOL: The resource pool enables you to create limits for resource usage. These limits are applied if other applications require the resources. If no other applications are running, the limits are not applied CLASSIFICATIONS: Classification functions group applications into workload groups so that limits can then be applied to their resource usage
17
Monitoring System Monitor objects: DMVs
Instance per pool: SQLServer: Resource Pool Stats (11 counters) Instance per group: SQLServer: Workload Group Stats (14 counters) DMVs sys.dm_resource_governor_configuration sys.dm_resource_governor_resource_pools sys.dm_resource_governor_workload_groups RESOURCE POOL: The resource pool enables you to create limits for resource usage. These limits are applied if other applications require the resources. If no other applications are running, the limits are not applied CLASSIFICATIONS: Classification functions group applications into workload groups so that limits can then be applied to their resource usage
18
11/16/ :26 AM demo Monitoring © 2007 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.
19
It’s Limitations Works with the Database Engine Instance Level!!! Single instance only Each instance controlled individually Can be combined with Windows System Resource Manager (WSRM) on Windows Server 2003 for CPU and memory control Controls for CPU usage and memory allocation ONLY I/O controls are planned for V2 (SQL SERVER 2008 R2???) Certain workloads may not be entirely suited – e.g. short-lived OLTP queries No chargeback mechanism But you can roll your own more easily using the monitoring Enterprise Edition Only
20
What to expect in SQL Server 2008 R2
New Extensions in SQL Server Management Studio New wizards will allow DBAs to quickly discover databases across their environment and enrol them into centralized multi-server management, Have insight into utilization within about 15 minutes
21
What to expect in SQL Server 2008 R2
DBAs can set policies to define desired utilization thresholds across target servers or applications within a new central management point Dashboard viewpoints provide insight into utilization and policy violations DBAs can set policies to define desired utilization thresholds across target servers or applications within a new central management point Dashboard viewpoints provide insight into utilization and policy violations to help identify consolidation opportunities, maximize investments and maintain healthy systems
22
Resource Management
23
Wednesday, 5 Aug – 09:00 File streaming
24
question & answer
25
Related Content Introducing Resource Governor Resource Governor in SQL Server Excellent document by Aaron Bertrand, Boris Baryshnikov Go To Search for “Using the Resource Governor”
26
Resources www.microsoft.com/teched www.microsoft.com/learning
Sessions On-Demand & Community Microsoft Certification & Training Resources Resources for IT Professionals Resources for Developers
27
Please complete the evaluation!
28
11/16/ :26 AM © 2009 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. © 2007 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.