5. V.102010 - 2020
A community for Greek professionals who use the
Microsoft Data Platform
Connect / Explore / Learn
WebminarsArticles
Videos News
EventsResources
@sqlschool@antoniosch
Sqlschoolgr
Page
Sqlschool
User Group
Sqlschool.gr
Group
SQLschoolGR
channel
6.
7. Take Your Career to New Heights
Save $50 USD
Register for PASS Summit 2020 and as a participant in SQLschool.gr,
you can save $50 USD the registration price.
To claim use code* LGDISET1I.
* Unique discount code cannot be applied retroactively and cannot be combined with any other offers.
9. When we need to
• Provide multitenancy and resource isolation on single instance of SQL
Server that serve multiple client workloads
• Provide predictable performance and support SLAs for workloads in
multi-workload and multi-user environment
• Isolate and limit runaway queries or throttle I/O resources for operations
Why we need Workload Management?
12. • SQL Server Database Engine
Enterprise Edition
• No workload management
between SQL Server instances.
• OLTP workloads are not always on
the CPU long enough to apply
bandwidth controls.
• I/O governance applies to user
operations.
• User read operations because
most write operations are typically
performed by system tasks.
• We cannot set I/O thresholds on
the internal resource pool.
Resources Governor Constraints
13. • Internal Pool
• Default Pool
• External Pool
• User-Defined Pools
• MIN_CPU_PERCENT
• MAX_CPU_PERCENT
• CAP_CPU_PERCENT
• MIN_MEMORY_PERCENT
• MAX_MEMORY_PERCENT
• MIN_IOPS_PER_VOLUME
• MAX_IOPS_PER_VOLUME
• AFFINITY SCHEDULER
• AFFINTY NUMA
Resource Pool
15. Resource Governor processSession
Login Authentication
Logon Trigger
Execution (if exist)
Classification
Internal Group Internal pool
Group A Pool A
Group B Pool B
Group N Pool N
Default group Default pool
16. Classification function
Evaluated for every new
session, even when
connection pooling is
enabled.
Sets workload group
context for the session.
If returns NULL, default, or
the name of non-existent
group the session is given
the default workload group
context.
The function should be
defined with server scope
(master database).
The classifier function
designation takes effect
after ALTER RESOURCE
GOVERNOR RECONFIGURE
is executed.
Only one function can be
designated as a classifier at
a time.
The classifier function
cannot be dropped or
altered unless its classifier
status is removed.
In the absence of a classifier
function, all sessions are
classified into the default
group.
The workload group
returned by the classifier
function is outside the
scope of the schema-
binding restriction.
The client session may time
out if the classification
function does not complete
within the specified time-
out for the login.
Enable the Dedicated
Administrator Connection
(DAC) on the server
17. Using Lookup Tables in a classifier function
Best practices for using Lookup Tables in a classifier function
Use
• Do not use a lookup table unless it is
absolutely necessary.
Limit the I/O performed for lookup tables.
• Use the TOP 1 to return only one row.
• Minimize the number of rows in the table.
• Make all rows of the table exist on a single
page, or a small number of pages.
• Confirm that rows found using the Index
Seek operations use as many seeking
columns as possible.
• De-normalize to a single table if you are
considering using multiple tables with joins.
Prevent blocking on the lookup table.
• Use the NOLOCK hint to prevent blocking or
use SET LOCK_TIMEOUT in the function with
a maximum value of 1,000 milliseconds.
• Table(s) must exist in the master database.
(The master database is the only database
that is guaranteed to be recovered when
the client computers attempt to connect).
• Always fully qualify the table name with the
schema. The database name is not
necessary since it must be the master
database.
• No triggers on the table.
• If you are updating the table contents, make
sure to use a snapshot isolation level
transaction in the classifier function to
prevent Writer blocking Readers. Note that
using the NOLOCK hint should also mitigate
this.
• If possible, disable the classifier function
when changing the table contents.
19. • sys.dm_resource_governor_configuration
Returns a row that contains the current in-memory configuration
state of Resource Governor.
• sys.dm_resource_governor_external_resource_pool_affinity
Returns CPU affinity information about the current external resource
pool configuration.
• sys.dm_resource_governor_external_resource_pools
Returns information about the current external resource pool state,
the current configuration of resource pools, and resource pool
statistics.
• sys.dm_resource_governor_resource_pool_affinity
Tracks resource pool affinity.
• sys.dm_resource_governor_resource_pools
Returns information about the current resource pool state, the
current configuration of resource pools, and resource pool statistics.
• sys.dm_resource_governor_resource_pool_volumes
Returns information about the current resource pool IO statistics for
each disk volume.
• sys.dm_resource_governor_workload_groups
Returns workload group statistics and the current in-memory
configuration of the workload group.
Resource Governor Related DMVs