using resource governor to control resource utilization

Post on 28-Nov-2014

241 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Dinesh AsankaDatabase SpecialistPearson Lanka (Pvt) Ltd.

http://twitter.com/dineshasankahttp://www.dbfriend.net/dinesha@ecollege.com

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?

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.

What We Want Is,

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.

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

compression.

• Setting workload priority.

RESOURCE GOVERNOR CONCEPTS

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.

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

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.

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

Source: MSDN

DEMO

RESOURCE GOVERNER

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

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

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.

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

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.

Q&AQUESTIONS & ANSWERS

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

top related