In the Resource Governor context, workload is a set of similarly sized queries or requests that can, and should be, treated as a single entity. This is not a requirement, but the more uniform the resource usage pattern of a workload is, the more benefit you are likely to derive from Resource Governor. Resource limits can be reconfigured in real time with minimal impact on workloads that are executing.
The following three concepts are fundamental to understanding and using Resource Governor:
Resource pools: Two resource pools (internal and default) are created when SQL Server 2012 is installed. Resource Governor also supports user-defined resource pools.
Workload groups: Two workload groups (internal and default) are created and mapped to their corresponding resource pools when SQL Server 2012 is installed. Resource Governor also supports user-defined workload groups.
Classification: There are internal rules that classify incoming requests and route them to a workload group. Resource Governor also supports a classifier user-defined function for implementing classification rules.
NOTE: By default the Resource Governor is disabled.
In the context of Resource Governor, you can treat the preceding concepts as components. The following illustration shows these components and their relationship with each other as they exist in the database engine environment. From a processing perspective, the simplified flow is as follows:
There is an incoming connection for a session (Session 1 of n).
- The session is classified (Classification).
- The session workload is routed to a workload group, for example, Group 4.
- The workload group uses the resource pool it is associated with, for example, Pool 2.
- The resource pool provides and limits the resources required by the application, for example, Application 3.
Resource Governor can be enabled in
following ways:
1. T-SQL
2. Object Explorer
3. Resource Governor Properties
Using T-SQL
Run ALTER RESOURCE GOVERNOR RECONFIGURE statement to enable Resource Governor.
Example:
ALTER
RESOURCE GOVERNOR RECONFIGURE;
GO
Using
Object Explorer
STEP 1: SQL Server Management Studio è Open Object Explorer and recursively è Expand the Management è Resource Governor.
STEP 2: Right-click Resource Governor è Click Enable.
Using Resource Governor Properties
STEP 1: In SQL Server Management Studio è Open Object Explorer and recursively è Expand the Management è Resource Governor.
STEP 2: Right-click Resource Governor è Click Properties, this opens the Resource Governor Properties page.
STEP 3: Check the Enable Resource Governor check box è Click OK.
Disable Resource Governor
Resource Governor can be disabled in
following ways:
1. T-SQL
2. Object Explorer
3. Resource Governor Properties
Using T-SQL
Run ALTER RESOURCE GOVERNOR DISABLE statement to enable Resource Governor.
Example:
GO
Using Object Explorer
STEP 2: Right-click Resource Governor è Click Disable.
STEP 2: Right-click Resource Governor è Click Properties, this opens the Resource Governor Properties page.
STEP 3: UnCheck the Enable Resource Governor check box è Click OK.
Resource Governor has two resource pools:
Using T-SQL
STEP 2: Run the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
Example:
CREATE RESOURCE POOL test_Pool WITH (MAX_CPU_PERCENT = 35);
GO
ALTER RESOURCE GOVERNOR RECONFIGURE;
GO
STEP 1: Run CREATE
RESOURCE POOL statement specifying the property values to be set.
STEP 2: Right-click Resource Governor è Properties.
STEP 3: In the Resource pools grid è Click the first column in the empty row. This column is labeled with an asterisk (*).
STEP 4: Double-click the empty cell in the Name column. Type in the name that you want to use for the resource pool.
STEP 6: Click OK to save the changes.
Resource Pool can be deleted in following
ways:
1. T-SQL
2. Object Explorer
Using T-SQL
STEP 1: Run the DROP RESOURCE POOL statement specifying the name of the resource pool to delete.
Example:
DROP RESOURCE POOL test_pool;
GO
ALTER RESOURCE GOVERNOR RECONFIGURE;
GO
STEP 2: Right-click the resource pool to be deleted è Click Delete.
STEP 3: In the Delete Object window, the resource pool is listed in the Object to be deleted list. To delete the resource pool è Click OK.