Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows Server

SQL Server 2008 R2 : Overview of Resource Governor, Resource Governor Components

11/15/2012 5:36:08 PM

Overview of Resource Governor

Resource Governor works by controlling the allocation of resources according to workloads. When a connection request is submitted to the Database Engine, the request is classified based on a classification function. The classification function is a scalar function that you define via T-SQL. The classification function evaluates information about the connection (for example, login ID, application name, hostname, server role) to determine how it should be classified. After the connection request is classified, it is routed to a workload group defined for that classification (or if the connection cannot be classified, it is routed to the default workload group). Each workload group is associated with a resource pool. A resource pool represents the physical resources of SQL Server (currently in SQL Server 2008, the only physical resources available for configuration are CPU and memory) and specifies the maximum amount of CPU and/or memory resources that are to be allocated to a specific type of workload. When a connection is classified and put into the correct workload group, the connection is allocated the CPU and memory resources assigned to it, and then the query is passed on to the query optimizer for execution. This process is illustrated in Figure 1.

Figure 1. Overview of the Resource Governor.

Resource Governor is designed to address the following types of resource issues, which are commonly found in a database environment:

  • Runaway queries— These resource-intensive queries can take up most or all of the server resources.

  • Unpredictable workload execution— This situation occurs when you have concurrent applications on the same server that are not isolated from each other, and the resulting resource contention causes unpredictable performance.

  • Workload prioritization— You might want to ensure that a critical workload is given priority to the system resources so it can process faster than other workloads or is guaranteed to complete if there is resource contention.

In addition to enabling you to classify incoming connections and route their workloads to a specific group, Resource Governor also enables you to do the following:

  • Monitor resource usage for each workload in a group

  • Pool resources and set pool-specific limits on CPU usage and memory allocation, which can prevent or minimize the probability of runaway queries

  • Associate grouped workloads with a specific pool of resources

  • Identify and set priorities for workloads

The current release of Resource Governor has the following limitations:

  • Resource allocation is only for CPU and memory usage. There is no support for managing network and disk I/O resource utilization.

  • Resource Governor manages only resource consumption of the Database Engine. You cannot use Resource Governor to manage workloads within SSAS, SSIS, or SSRS.

In the following sections, you learn how to set up and configure Resource Governor for use, how Resource Governor works under the hood, and how you can use Resource Governor to better prioritize and manage a SQL Server’s workload.

Resource Governor Components

Resource Governor consists of three main components: classification, workload groups, and resource pools. Understanding these three components and how they interact is important to understanding and using Resource Governor.

Classification

Classification is the process of evaluating incoming user connections and assigning them to a workload group. Classification is performed by logic contained in a user-defined function. The function returns the workload group name, which Resource Governor uses to route the sessions into the appropriate workload groups.

When Resource Governor is configured, the login process for a session consists of the following steps:

1.
Login authentication

2.
LOGON trigger execution

3.
Classification

Workload Groups

Workload groups are the containers for similar connections, which are grouped together as similar according to the classification criteria applied to each connection. A workload group also provides the mechanism for aggregate monitoring of resource consumption.

Resource Governor has two predefined workload groups: the internal group and default group. The internal workload group is used solely by internal Database Engine processes. You cannot change the classification criteria for the internal group, and you also cannot classify any user requests for assignment to the internal group. You can, however, monitor the internal group.

Connection requests are automatically classified into the default group when the following conditions exist:

  • There are no criteria to classify a request.

  • There is an attempt to classify the request into a nonexistent group.

  • There is a general classification failure.

Resource governor supports a total of 20 workload groups. Because two of them are reserved for the internal and default workload groups, a total of 18 user-defined workload groups can be defined.

Resource Pools

A resource pool, or pool, represents the allocation of physical resources of the SQL Server. A resource pool has two parts:

  • The first part specifies the minimum resource reservation. This part of the resource pool does not overlap with other pools.

  • The other part specifies the maximum possible resource reservation for the pool. The resource allocation is shared with other pools.

In SQL Server 2008 and SQL Server 2008 R2, the pool resources are set by specifying a MIN or MAX allocation for CPU and a MIN or MAX allocation for memory. The MIN setting specifies the minimum guaranteed resource availability of the pool. The MAX setting sets the maximum size of the pool for each of the resources.

Because there cannot be any overlap in the minimum resource reservation, the sum of the MIN values across all pools cannot exceed 100% of the total server resources. The ensures that each pool is guaranteed the specified resource allocation.

The MAX value can be set anywhere in the range between the MIN value and 100% inclusive. The MAX setting represents the maximum amount of resources a session can consume, as long as the resources are available and not in use by another pool that is configured with a nonzero MIN value. When a pool has a nonzero MIN percentage defined, the effective MAX value of other pools is readjusted down, as necessary, to the existing MAX value minus the sum total of the MIN values of other pools.

For example, consider you have two user-defined pools. One pool, Pool1, is defined with a MIN setting of 20% and a MAX setting of 100%. The other pool, Pool2, is defined with a MIN setting of 50% and a MAX setting of 70%. The resulting effective MAX setting for Pool1 is 50% (100% minus the MIN 50% of Pool2). The effective MAX setting of Pool2, however, remains at 70% rather than 80% because 70% is the configured MAX value of Pool2.

The shared part of the pool (the amount between the MIN and effective MAX values) is used to determine the amount of resources that can be consumed by the pool if the resources are available and not being consumed by another pool. When resources are consumed by a pool, they are assigned to the specified pool and are not shared until processing completes in that pool.

To illustrate this further, consider a scenario in which there are three user-defined resource pools:

  • PoolA is defined with a MIN % of 10 and MAX % of 100.

  • PoolB is defined with a MIN % of 35 and a MAX % of 90.

  • PoolC is defined with a MIN % of 30 and a MAX % of 80.

The effective MAX of PoolA would be calculated as follows:

MAX % of PoolA100
minus MIN % of PoolB35
minus MIN % of PoolC30
equals EFF MAX of PoolA35

The total Shared % of resources of PoolA would then be calculated as follows:

Effective MAX % of PoolA35
minus MIN % of PoolA10
equals Shared % of PoolA25

Table 1 illustrates the calculated effective MAX and Shared % values for all pools in this configuration.

Table 1. Effective MAX and Shared % Values for Multiple Pools
ResourcePoolMIN %MAX %Effective MAX %Shared %
Internal0100100100
Default01002525
PoolA101003525
PoolB35905015
PoolC3080355

To coincide with the predefined workload groups, Resource Governor also has two predefined resource pools: the internal pool and default pool.

The internal pool represents the resources consumed by the internal processes of the Database Engine. This pool always contains only the internal group, and the pool is not alterable in any way. The Internal Pool has a fixed MIN % of 0 and a MAX % of 100, and resource consumption by the internal pool is not restricted or reduced by any settings in other pools. In other words, the effective MAX of the Internal Pool is always 100%. Any workloads in the internal pool are considered critical for server function, and Resource Governor allows the internal pool to consume 100% of available resources if necessary, even if it means the violation of the resource requirements of the other pools.

The default pool is the first predefined user pool. Prior to any configuration, the default pool contains only the default group. The default pool cannot be created or dropped, but it can be altered. The default pool can contain user-defined groups in addition to the default group.

Now that you have an understanding of the Resource Governor components, let’s put them into use by enabling and setting up some resource groups.

Other -----------------
- Microsoft Dynamic GP 2010 : Sales Order Processing (part 2)
- Microsoft Dynamic GP 2010 : Sales Order Processing (part 1) - Sales Order Processing Setup, Sales Document Setup
- Planning and Designing a Public Key Infrastructure : Creating a Certificate Management Plan
- Planning and Designing a Public Key Infrastructure : Designing the CA Hierarchy
- Planning and Designing a Public Key Infrastructure : Identifying PKI Requirements
- Share point 2010 : Managing Data Connections (part 4) - Modifying BDC Objects, Using External System Throttling
- Share point 2010 : Managing Data Connections (part 3) - Creating a Profile Page, Creating External Data Actions
- Share point 2010 : Managing Data Connections (part 2) - Creating BDC Models, Importing BDC Models
- Share point 2010 : Managing Data Connections (part 1) - Setting BCS Permissions, Configuring Profile Page Creation
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Unified Messaging Architecture (part 2)
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Unified Messaging Architecture (part 1)
- Designing and Configuring Unified Messaging in Exchange Server 2007 : Unified Messaging Features
- System Center Configuration Manager 2007 : Operating System Deployment - What Works Best for You
- System Center Configuration Manager 2007 : Operating System Deployment - Tools Overview
- Windows Server 2003 on HP ProLiant Servers : Migration Tools (part 2)
- Windows Server 2003 on HP ProLiant Servers : Migration Tools (part 1)
- SQL SErver 2008 : Resource Governor in action
- SQL SErver 2008 : Resource Governor - Workload groups, Resource pools
- Windows Server 2008 Server Core : emoving Files with the Del and Erase Commands, Compressing Files with the Diantz and MakeCab Utilities
- Windows Server 2008 Server Core : Comparing Two Files with the Comp Utility, Copying Files with the Copy Command
 
 
Most view of day
- Managing Client Protection : Using Windows Defender (part 1)
- Microsoft SharePoint 2013 : Looking at Visio Services (part 2) - Adding a Visio Web Access Web Part to a page
- Windows Server 2012 : Support for open standards
- Windows Server 2012 Administration : Configuring Sites (part 1) - Creating a Site - Creating Site Subnets
- Maintaining Dynamics GP : Validating balances with the Reconcile utility
- Microsoft Lync Server 2010 : Planning for Voice Deployment - Voice Resilience
- Microsoft Dynamics AX 2009 : Integration with Microsoft Office - Exporting data to Microsoft Project
- Windows Server 2003 on HP ProLiant Servers : Logical Structure Design (part 2) - Forest Structure, OU Structure
- Windows Server 2008 R2 high-availability and recovery features : Installing and Administering Failover Clustering (part 7) - Create shared folder on cluster, Testing Failover of Cluster
- Creating DVD Movies with Windows DVD Maker (part 3) - Understanding DVD Movie Options
Top 10
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 3) - Creating IPv4 DHCP Scopes
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 2) - Installing DHCP Server and Server Tools
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 1)
- Windows Server 2012 : DHCP,IPv6 and IPAM - Understanding the Components of an Enterprise Network
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 3) - Translating Text with the Mini Translator
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 2) - Translating a Word or Phrase with the Research Pane
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 1) - Setting Options for the Research Task Pane, Searching with the Research Task Pane
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 2) - Ending a Linked Notes Session, Viewing Linked Notes
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 1) - Beginning a Linked Notes Session
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 3) - Moving Side Notes to Your Existing Notes
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro