using resource governor to control resource utilization

20
Dinesh Asanka Database Specialist Pearson Lanka (Pvt) Ltd. http://twitter.com/dineshasanka http://www.dbfriend.net/ [email protected] RESOURCE GOVERNOR TO CONTROL RESOURCE UTILIZATION

Upload: sql-server-sri-lanka-user-group

Post on 28-Nov-2014

241 views

Category:

Technology


4 download

DESCRIPTION

201201 - Session 1 Using Resource Governor to Control Resource Utilization Dinesh Asanka (@dineshasanka)

TRANSCRIPT

Page 1: Using Resource Governor to Control Resource Utilization

Dinesh AsankaDatabase SpecialistPearson Lanka (Pvt) Ltd.

http://twitter.com/dineshasankahttp://www.dbfriend.net/[email protected]

RESOURCE GOVERNOR TO CONTROL RESOURCE UTILIZATION

Page 2: Using Resource Governor to Control Resource Utilization

Forum Post•My SQL Server is accessed by several end user applications. •When all the applications are in action my server performance is bad. • Some of those applications are business critical hence they should not be disturbed by other application. • How to allocate specific hardware resources for these business critical applications?

Page 3: Using Resource Governor to Control Resource Utilization

What are your solutions for this?• Move relevant databases to a different server.• You can use SQL Server techniques like Mirroring, Log shipping, Database Snapshot and Replication.

Page 4: Using Resource Governor to Control Resource Utilization

What We Want Is,

Page 5: Using Resource Governor to Control Resource Utilization

What is Resource Governor• Resource Governor is a new technology in SQL Server 2008.• Resource Governor enables you to differentiate these workloads and allocate shared resources as they are requested, based on the limits that you specify.• Resource Governor is a quota system for SQL Server Resource. • These resources are CPU and memory.

Page 6: Using Resource Governor to Control Resource Utilization

Types of Resource Issues• “Non-Ending” queries.• Unpredictable work loads. • Limiting the CPU usage by backup jobs using backup

compression.

• Setting workload priority.

Page 7: Using Resource Governor to Control Resource Utilization

RESOURCE GOVERNOR CONCEPTS

Page 8: Using Resource Governor to Control Resource Utilization

Workload Groups•Way of grouping loads by tasks, connections• Assigned to a specific resource pool• Internal tasks are part of internal Workload Group.• e.g. Checkpoint, Ghost Cleanup• Internal groups do not have any limits and can over turn

other groups regardless of their limits.• Default group for the behavior of no resource governor

running and will over turn by other groups.

Page 9: Using Resource Governor to Control Resource Utilization

Workload Groups Options

Option DescriptionDefaul

t

IMPORTANCEImportance between workload groups using the same resource pool.

MEDIUM

REQUEST_MAX_MEMORY_GRANT_PERCENT

Max memory grant from the resource pool for query execution.

25%

REQUEST_MEMORY_GRANT_TIMEOUT_SEC

How long to wait for a query execution memory grant .

0

REQUEST_MAX_CPU_TIME_SEC Max amount of CPU time a request can use 0

MAX_DOP Max degree of parallelism. 0

GROUP_MAX_REQUESTS Maximum concurrent requests per group. 0

Page 10: Using Resource Governor to Control Resource Utilization

Classification• Incoming connection are classified into Workload Groups.• T-SQL function• HOST_NAME, APP_NAME, SUSER_NAME, IS_MEMBER, CONNECTIONPROPERTY are the system functions we can used.

Page 11: Using Resource Governor to Control Resource Utilization

Resource Pools• A resource pool is to limit resource consumption for one or more workload groups.

OptionDefaul

t

MIN_CPU_PERCENT 0

MAX_CPU_PERCENT 100

MIN_MEMORY_PERCENT 0

MAX_MEMORY_PERCENT 100

• Default and internal pools has the above values which cannot be altered.

• Number of pools should be less than 20

Page 12: Using Resource Governor to Control Resource Utilization

Source: MSDN

Page 13: Using Resource Governor to Control Resource Utilization

DEMO

RESOURCE GOVERNER

Page 14: Using Resource Governor to Control Resource Utilization

Monitoring• Perfmon• SQLServer: Resource Pool Stats• SQLServer:Workload Group Stats

• DMVs• sys.dm_resource_governor_configuration• sys.dm_resource_governor_workload_groups• sys.dm_resource_governor_resource_pools

• Modified DMVS• sys.dm_exec_requests• sys.dm_os_memory_brokers

Page 15: Using Resource Governor to Control Resource Utilization

New in Denali • Support for 64 resource pools• Enhanced CPU usage controls• Enhanced resource allocation

Page 16: Using Resource Governor to Control Resource Utilization

My Field Notes• Alter large table with 150 millions rows without effecting current load.• One Column was changed varchar(8000) to nvarchar(max).• Another Column was change to text to varchar(max)• High CPU due to page splits and conversion took 7-8 hrs.

Page 17: Using Resource Governor to Control Resource Utilization

PN• Resource Governor does not impose any controls on a dedicated administrator connection aka DAC.

Page 18: Using Resource Governor to Control Resource Utilization

Limitations• Resource management is limited to the SQL Server Database Engine.• There is limited workload monitoring or workload management between SQL Server instances.• Limit specification applies to CPU bandwidth and memory managed by SQL Server.• Resource Governor is available only on the Enterprise, Developer, and Evaluation editions of SQL Server.

Page 19: Using Resource Governor to Control Resource Utilization

Q&AQUESTIONS & ANSWERS

Page 20: Using Resource Governor to Control Resource Utilization

Resources• http://www.sql-server-performance.com/2008/resource-governor-in-sql-server-2008/

• http://msdn.microsoft.com/en-us/library/bb933866.aspx

Required slide