0% found this document useful (0 votes)
57 views28 pages

Managing and Optimizing Resources For SQL Server: Balmukund Lakhani Technical Lead - SQL Support Team

Uploaded by

rajbmohan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views28 pages

Managing and Optimizing Resources For SQL Server: Balmukund Lakhani Technical Lead - SQL Support Team

Uploaded by

rajbmohan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Managing and Optimizing

Resources for SQL Server

Balmukund Lakhani
Technical Lead – SQL Support Team
http://blogs.msdn.com/SQLServerFAQ
http://blogs.msdn.com/BLakhani
About me
Currently
Technical Lead – SQL Support Team.
Owner http://blogs.msdn.com/SQLServerFAQ
Active Participant in MSDN Forum for SQL.
In past
Sr. Support Engineer - Microsoft
Premier Field Engineer – Microsoft
Support Engineer - Microsoft
ERP Consultant – Ramco Systems
Sr. Systems Analyst – Ramco Systems
SQL Developer / DBA – Ramco Systems
Agenda
Managing Resources
Key Concepts of Resource Governor
Configuration
Usage Scenarios
Why there is a need of Resource Governor
MANAGING RESOURCES
Why Resource Governor?
There have been asks for “limits”
Control Run-away queries.
Give control to DBA.
SQL 2005 Resource
Management
SQL Server
Single resource pool
Database engine doesn’t
Backup differentiate workloads
OLTP
Admin Tasks Activity Best effort resource
Executive
sharing
Ad-hoc
Reports Reports

Workloads

Memory, CPU,
Threads
Resources
Resources
Tell me more…
KEY CONCEPTS
Concepts…
Classifier Function
• Classify connection to workload group

Workload Group
• Aggregate similar session requests

Resource Pool
• Manage server’s physical resources
Resource Governor – Workloads
SQL Server
Ability to differentiate
workloads
Executive
Backup
Reports e.g. app_name, login
OLTP
Activity
Per-request limits
Admin Tasks Ad-hoc Max memory %
Reports
Max CPU time
Grant timeout
Admin OLTP Report
Workload Workload Workload Max Requests
Resource monitoring
Memory, CPU,
Threads

Resources
Resource Governor – Importance
SQL Server
A workload can have an
importance label
Executive
Backup Low
Reports
OLTP Medium
Activity
Admin Tasks Ad-hoc
High
Reports Gives resource allocation
preference to workloads
Admin
High
OLTP Report
based on importance
Workload Workload Workload

Memory, CPU,
Threads

Resources
Resource Governor – Pools
SQL Server
Resource pool: A virtual
Executive
subset of physical
Backup
Reports database engine
OLTP
Activity resources
Admin Tasks Ad-hoc Provides controls to
specify
Reports

High Min Memory %


Admin OLTP Report
Workload Workload Workload Max Memory %
Min CPU %
Max CPU %
Min
Min Memory
Max
Memory 10%
10% Max CPU Max DOP
Max Memory
Memory 20%
20%
90%
Resource monitoring
Max
Max CPU
CPU 20%
20%

Admin Pool Application Pool


Up to 20 resource pools
Putting it all together
SQL Server
Workloads are mapped
Executive
to Resource Pools (n :
Backup
Reports 1)
OLTP
Activity Online changes of
Admin Tasks Ad-hoc groups/pools
Reports
SQL Server 2005 =
Admin
High
OLTP Report
default group + default
Workload Workload Workload pool
Main Benefit
Min Memory 10% Prevent run-away queries
Max Memory 20% Max CPU 90%
Max CPU 20%
Admin Pool Application Pool
Classifier Function Code
host_name () UDF rules apply:
app_name () No data modification
suser_name () No DCL
No transactions
suser_sname ()
No stored procedures
is_srvrolemember () No XPs with rowset
is_member () No EXEC
original_db_name () No linked servers
loginproperty
connectionproperty
Show me the demo…
CONFIGURATION
Quick Recap
Resource Governor
(in action)

demo
Let’s take a look at runaway query.
Oops!!! that didn’t go well…
Why didn’t SQL Server put a limit on the
CPU that the query was using?

If there are no other cars on the road, why


should the governor slow down the solo
driver?

Why don’t we try that again, but this time we


will add one more session
Resource Governor
(in action)

demo
Let’s take a look at that runaway query
again.
Monitoring Resource Governor
Metadata CVs:
sys.resource_governor_resource_pools
sys.resource_governor_workload_groups
sys.resource_governor_configuration

Running value DMVs:


sys.dm_resource_governor_resource_pools
sys.dm_resource_governor_workload_groups
Where can you use?
USAGE SCENARIOS
Consolidation

Problem: Solution:
My users won’t let me put Configure RG by application
Payroll and GL on the same or database to minimise
server. interference.

3rd party packages have Offer enhanced performance


unknown, uncontrollable for key business cycles, such
queries. as pay-day or end-of-
quarter.
Ad-hoc Reporting
Problem: Solution:

Excel and Access users use Create workload groups by


production databases for application, such as ‘%excel
workgroup applications. %’ and ‘%access%’

Particularly for reporting, we Assign those workload


can’t control their impact on groups to a low-priority
transaction processing . resource pool.

Use workload connection


limits to restrict concurrent
usage.
Limitations
Database Engine only – no SSAS, SSRS, SSIS
Many components are not subject to RG, for
example sp_OA, linked server queries, XPs,
database mail
Limit of 18 user-defined resource pools (20
total)
Cannot constrain internal pools / groups
No throttling of I/O yet.
Enterprise Edition only!
Home work…
WHAT’S NEXT?
What Else Can You Do?
This is just a quick start to the resource
governor, we can do much more with this.
Classifiers based on other criteria
Time of day
Application connecting to certain DB
Using the DMVs to determine issues and
modify workload groups or resource pools
on the fly
Much more!
More Resources…
Books Online
www.SQLCommunity.com
http://blogs.msdn.com/b/psssql
http://blogs.technet.com/b/sqlos
Questions???
© 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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy