Skip to content

Commit 0c1a296

Browse files
authored
Merge pull request #282052 from WilliamDAssafMSFT/20240729-smallrc
20240729 smallrc
2 parents 62202da + 4a17259 commit 0c1a296

File tree

6 files changed

+174
-164
lines changed

6 files changed

+174
-164
lines changed
Loading
Loading

articles/synapse-analytics/sql-data-warehouse/resource-classes-for-workload-management.md

Lines changed: 62 additions & 56 deletions
Large diffs are not rendered by default.

articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-how-to-troubleshoot-missed-classification.md

Lines changed: 91 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ description: Identify and troubleshoot scenarios where workloads are misclassifi
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
66
ms.reviewer: wiassaf
7-
ms.date: 03/09/2022
7+
ms.date: 07/29/2024
88
ms.service: synapse-analytics
99
ms.subservice: sql-dw
1010
ms.topic: how-to
11-
ms.custom: template-how-to
11+
ms.custom:
12+
- template-how-to
1213
---
1314

14-
# Troubleshooting a misclassified workload in Azure Synapse Analytics
15+
# Troubleshoot a misclassified workload in Azure Synapse Analytics
1516

1617
This article covers guidance on how to troubleshoot a misclassified workload, and how to identify the reason behind the classification, for workloads in a dedicated SQL pool.
1718

@@ -20,7 +21,9 @@ Azure Synapse Analytics provides workload management capabilities like [classify
2021
However, in some scenarios, a combination of these capabilities can lead to workload classification that doesn't reflect user intent. This article lists such common scenarios and how to troubleshoot them. First, you should query basic information for troubleshooting misclassified workload scenarios.
2122

2223
> [!NOTE]
23-
> Classifying managed identities (MI) behavior differs between the dedicated SQL pool in Azure Synapse workspaces and the standalone dedicated SQL pool (formerly SQL DW). While the standalone dedicated SQL pool MI maintains the assigned identity, for Azure Synapse workspaces the MI runs as **dbo**. This cannot be changed. The dbo role, by default, is classified to smallrc. Creating a classifier for the dbo role allows for assigning requests to a workload group other than smallrc. If dbo alone is too generic for classification and has broader impacts, consider using label, session or time-based classification in conjunction with the dbo role classification.
24+
> Classifying managed identities behavior differs between the dedicated SQL pool in Azure Synapse workspaces and the standalone dedicated SQL pool (formerly SQL DW). While the standalone dedicated SQL pool managed identity maintains the assigned identity, for Azure Synapse workspaces the managed identity runs as `dbo`. This cannot be changed. The dbo role, by default, is classified to smallrc. Creating a classifier for the dbo role allows for assigning requests to a workload group other than smallrc. If dbo alone is too generic for classification and has broader impacts, consider using label, session or time-based classification in conjunction with the dbo role classification.
25+
>
26+
> Except for smallrc, the dynamic resource classes are implemented as pre-defined database roles. Smallrc does not appear as a database role, but is the [Default resource class](resource-classes-for-workload-management.md#default-resource-class).
2427
2528
## Basic troubleshooting information
2629

@@ -44,7 +47,7 @@ To get a list of all workload groups (including system workload groups) and asso
4447
1. In the left side pane, select **Workload management** under **Settings**.
4548
1. Under **Workload groups** section, all workloads are listed. By default only **User-Defined Workload groups** are listed. To view a list of both user-defined and system-defined workload groups, edit the filter and **Select All**.
4649

47-
:::image type="content" source="./media/sql-data-warehouse-how-to-troubleshoot-missed-classification/filter-all-workload-groups.png" alt-text="Workload Group List filter" lightbox="./media/sql-data-warehouse-how-to-troubleshoot-missed-classification/filter-all-workload-groups.png":::
50+
:::image type="content" source="media/sql-data-warehouse-how-to-troubleshoot-missed-classification/filter-all-workload-groups.png" alt-text="Screenshot from the Azure portal of a user-defined workload group list filter.":::
4851

4952
#### T-SQL
5053

@@ -63,7 +66,7 @@ For more information, see [sys.workload_management_workload_groups](/sql/relatio
6366

6467
To list all workload classifiers (including system-defined classifiers) by workload group in the Azure portal, see the numbers listed in **Classifiers** column in Workload group table (see previous section).
6568

66-
:::image type="content" source="./media/sql-data-warehouse-how-to-troubleshoot-missed-classification/view-workload-classifiers.png" alt-text="Workload Group Classifier List" lightbox="./media/sql-data-warehouse-how-to-troubleshoot-missed-classification/view-workload-classifiers.png":::
69+
:::image type="content" source="media/sql-data-warehouse-how-to-troubleshoot-missed-classification/view-workload-classifiers.png" alt-text="Screenshot from the Azure portal of a workload group classifier list." lightbox="media/sql-data-warehouse-how-to-troubleshoot-missed-classification/view-workload-classifiers.png":::
6770

6871
#### T-SQL
6972

@@ -110,7 +113,7 @@ Consider following scenario:
110113

111114
1. A database user, DBAUser, is assigned to largerc resource class role using `sp_addrolemember` procedure.
112115
1. DBAUser has created a new workload group and classifier using workload management.
113-
1. A newly-created workload classifier maps database role DBARole to mediumrc resource class with high importance.
116+
1. A newly created workload classifier maps database role DBARole to mediumrc resource class with high importance.
114117
1. DBAUser is a made a member of the DBARole database role.
115118
1. When DBAUser runs a query, the query is expected to run on mediumrc based on workload classifier. Instead it will be assigned to largerc, as **user** mapping takes precedence over **role membership** mapping to a classifier.
116119

@@ -132,16 +135,13 @@ EXEC sp_droprolemember '[Resource Class]', membername;
132135

133136
### Some administrative users are always mapped to smallrc workload group
134137

135-
Consider a scenario for the Azure Synapse Workspace SQL Admin login, the Azure Synapse Microsoft Entra admin (user or group member), or a database owner. These users may still have a workload classifier or have been added to a resource class role other than smallrc. All queries executed by these user will still run on smallrc resource class, even though the user is mapped to a different resource class or workload group.
138+
Consider a scenario for the Azure Synapse Workspace SQL Admin login, the Azure Synapse Microsoft Entra admin (user or group member), or a database owner. These users might still have a workload classifier or have been added to a resource class role other than smallrc. All queries executed by these users will still run on smallrc resource class, even though the users are mapped to a different resource class or workload group.
136139

137140
**Recommendation**: These administrative users can't change their default workload group. For more information, see [workload management with resource classes](resource-classes-for-workload-management.md#default-resource-class). It is recommended that critical or performance-sensitive workloads not run as one of these administrative users in the dedicated SQL pool.
138141

139-
The Azure Synapse Workspace SQL Admin login and the Azure Synapse Microsoft Entra admin (user or group member) are specified in the Azure portal:
140-
141-
:::image type="content" source="./media/sql-data-warehouse-how-to-troubleshoot-missed-classification/identify-sql-admin.png" alt-text="Identifying the service admin by looking at the Workspace SQL Admin Login field" lightbox="./media/sql-data-warehouse-how-to-troubleshoot-missed-classification/identify-sql-admin.png":::
142-
143-
Similarly, the database owner (dbo) and **db_owner** database roles are not allowed to change their default resource class. If a user is either the database owner or added under **db_owner** database role, all queries executed by the user go to smallrc by default. These roles can't be added to a resource class other than smallrc. However, if a user who is part of this role would like to classify their queries to a different workload group, they can use MEMBERNAME option in [workload classifier definition](sql-data-warehouse-workload-classification.md).
142+
The Azure Synapse Workspace SQL Admin login and the Azure Synapse Microsoft Entra admin (user or group member) are specified in the Azure portal, on the **Overview** page of the dedicated SQL pool.
144143

144+
Similarly, the database owner (dbo) and **db_owner** database roles are not allowed to change their default resource class. If a user is either the database owner or added under **db_owner** database role, all queries executed by the user go to smallrc by default. These roles can't be added to a resource class other than smallrc. However, if a user who is part of this role would like to classify their queries to a different workload group, they can use `MEMBERNAME` option in [workload classifier definition](sql-data-warehouse-workload-classification.md).
145145

146146
### Use workload group precedence for better classification
147147

@@ -157,9 +157,9 @@ In scenarios where resource classes are being used it's best to create a dedicat
157157
1. Dynamic resource class takes precedence over static resource class. For example, if a user is member of mediumrc (dynamic) and staticrc80(static), user queries run with mediumrc.
158158
1. Bigger resource classes are preferred over smaller resource classes. For example, if a user is member of staticrc20 and staticrc80, then user queries will run with staticrc80.
159159

160-
#### If Workload Management Capabilities are used
160+
#### If workload management capabilities are used
161161

162-
WLM provides capability to create multiple workload classifiers for same user or workload group. Classifier definition statement has multiple parameters based on which incoming requests are assigned to workloads. These parameters have a **weight** score as shown below and this score determines order of precedence:
162+
Workload management (WLM) capabilities provide capability to create multiple workload classifiers for same user or workload group. Classifier definition statement has multiple parameters based on which incoming requests are assigned to workloads. These parameters have a **weight** score as shown below and this score determines order of precedence:
163163

164164
|**Classifier parameter** |**Weight** |
165165
|---------------------|---------|
@@ -186,7 +186,7 @@ CREATE WORKLOAD CLASSIFIER CLASSIFIER-2 WITH
186186
,IMPORTANCE = 'Low')
187187
```
188188

189-
Queries submitted by User-1 can be submitted via both classifiers. Query run by User-1 with the 'dimension_loads' label between 6PM and 7AM UTC will be assigned to `wgDashboards` as weight score of WLM_LABEL is higher than START_TIME/END_TIME. The weighting of `CLASSIFIER-1` is 80 (64 for user, plus 16 for WLM_LABEL). The weighting of `CLASSIFIER-2` is 68 (64 for user, 4 for START_TIME/END_TIME).
189+
Queries submitted by User-1 can be submitted via both classifiers. Query run by User-1 with the `dimension_loads` label between 6PM and 7AM UTC will be assigned to `wgDashboards` as weight score of `WLM_LABEL` is higher than `START_TIME`/`END_TIME`. The weighting of `CLASSIFIER-1` is 80 (64 for user, plus 16 for `WLM_LABEL`). The weighting of `CLASSIFIER-2` is 68 (64 for user, 4 for `START_TIME`/`END_TIME`).
190190

191191
For more information on workload classification, see [classification weighting](sql-data-warehouse-workload-classification.md#classification-weighting) and [query labels](../sql/develop-label.md).
192192

@@ -214,85 +214,87 @@ If a user runs a query with `OPTION (LABEL = 'dimension_loads')`, it can be clas
214214

215215
If there was a tie in workload groups or classifiers, following precedence takes effect:
216216

217-
1. The workload group with the highest resource allocation is chosen. This behavior optimizes for performance in scenarios where logins are members of multiple resource classes. This behavior also ensures backward compatibility.
217+
1. The workload group with the highest resource allocation is chosen. This behavior optimizes for performance in scenarios where logins are members of multiple resource classes. This behavior also ensures backward compatibility.
218+
219+
Consider the following two workload groups and workload classifiers:
220+
221+
```sql
222+
-- Workload Groups
223+
CREATE WORKLOAD GROUP wgDataLoad
224+
WITH
225+
( MIN_PERCENTAGE_RESOURCE = 26
226+
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2
227+
,CAP_PERCENTAGE_RESOURCE = 100 )
218228

219-
Consider the following two workload groups and workload classifiers:
229+
CREATE WORKLOAD GROUP wgUserqueries
230+
WITH
231+
( MIN_PERCENTAGE_RESOURCE = 15
232+
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 5
233+
,CAP_PERCENTAGE_RESOURCE = 50 );
234+
235+
--Workload Classifiers
236+
CREATE WORKLOAD CLASSIFIER CLASSIFIER-1 WITH
237+
( WORKLOAD_GROUP = 'wgDataLoad'
238+
,MEMBERNAME = 'USER-1'
239+
,WLM_LABEL = 'dimension_loads'
240+
,IMPORTANCE = 'High');
241+
242+
CREATE WORKLOAD CLASSIFIER CLASSIFIER-2 WITH
243+
( WORKLOAD_GROUP = 'wgUserqueries'
244+
,MEMBERNAME = 'USER-1'
245+
,WLM_LABEL = 'dimension_loads'
246+
,IMPORTANCE = 'High');
247+
```
248+
249+
If a user runs a query with `OPTION (LABEL = 'dimension_loads')`, the query meets criteria for both the classifiers. However, the user request will be routed to `wgUserQueries` workload group as it has higher minimum resource allocation per request.
220250

221-
```sql
222-
-- Workload Groups
223-
CREATE WORKLOAD GROUP wgDataLoad
224-
WITH
225-
( MIN_PERCENTAGE_RESOURCE = 26
226-
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2
227-
,CAP_PERCENTAGE_RESOURCE = 100 )
228-
229-
CREATE WORKLOAD GROUP wgUserqueries
230-
WITH
231-
( MIN_PERCENTAGE_RESOURCE = 15
232-
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 5
233-
,CAP_PERCENTAGE_RESOURCE = 50 );
234-
235-
--Workload Classifiers
236-
CREATE WORKLOAD CLASSIFIER CLASSIFIER-1 WITH
237-
( WORKLOAD_GROUP = 'wgDataLoad'
238-
,MEMBERNAME = 'USER-1'
239-
,WLM_LABEL = 'dimension_loads'
240-
,IMPORTANCE = 'High');
241-
242-
CREATE WORKLOAD CLASSIFIER CLASSIFIER-2 WITH
243-
( WORKLOAD_GROUP = 'wgUserqueries'
244-
,MEMBERNAME = 'USER-1'
245-
,WLM_LABEL = 'dimension_loads'
246-
,IMPORTANCE = 'High');
247-
```
248-
249-
If a user runs a query with `OPTION (LABEL = 'dimension_loads')`, the query meets criteria for both the classifiers. However, the user request will be routed to `wgUserQueries` workload group as it has higher minimum resource allocation per request.
250-
251251
2. Next, concurrency setting and available concurrency for respective workload groups is considered for tie-breakers. The workload group with the highest available concurrency at a time when request arrived will give the query best chance of executing.
252-
253-
Consider following two workload groups and workload classifiers:
254-
255-
```sql
256-
--Workload Groups
257-
CREATE WORKLOAD GROUP wgDataLoad
258-
WITH
259-
( MIN_PERCENTAGE_RESOURCE = 30
260-
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2 (concurrency of 15)
261-
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2
262-
,CAP_PERCENTAGE_RESOURCE = 100 );
263-
264-
CREATE WORKLOAD GROUP wgUserqueries
265-
WITH
266-
( MIN_PERCENTAGE_RESOURCE = 30
267-
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2 (concurrency of 15)
268-
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2
269-
,CAP_PERCENTAGE_RESOURCE = 100 );
270-
271-
-- Workload Classifiers
272-
CREATE WORKLOAD CLASSIFIER CLASSIFIER-1 WITH
273-
( WORKLOAD_GROUP = 'wgDataLoad'
274-
,MEMBERNAME = 'USER-1'
275-
,WLM_LABEL = 'dimension_loads'
276-
,IMPORTANCE = 'High');
277-
278-
CREATE WORKLOAD CLASSIFIER CLASSIFIER-2 WITH
279-
( WORKLOAD_GROUP = 'wgUserqueries'
280-
,MEMBERNAME = 'USER-1'
281-
,WLM_LABEL = 'dimension_loads'
282-
,IMPORTANCE = 'High');
283-
```
284-
285-
If a user runs a query with `OPTION (LABEL = 'dimension_loads')`, both the classifiers have a tie as the query meets criteria for both. When user submits the query, consider the scenario where five concurrent queries are getting executed in the `wgUserqueries` group and ten queries are getting executed in the `wgDataLoad` group. The user request will be routed to `wgUserqueries` group using `CLASSIFIER-2`, as the `wgUserqueries` workload group has higher available concurrency at the time the user submitted a query.
286-
252+
253+
Consider following two workload groups and workload classifiers:
254+
255+
```sql
256+
--Workload Groups
257+
CREATE WORKLOAD GROUP wgDataLoad
258+
WITH
259+
( MIN_PERCENTAGE_RESOURCE = 30
260+
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2 (concurrency of 15)
261+
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2
262+
,CAP_PERCENTAGE_RESOURCE = 100 );
263+
264+
CREATE WORKLOAD GROUP wgUserqueries
265+
WITH
266+
( MIN_PERCENTAGE_RESOURCE = 30
267+
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2 (concurrency of 15)
268+
,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2
269+
,CAP_PERCENTAGE_RESOURCE = 100 );
270+
271+
-- Workload Classifiers
272+
CREATE WORKLOAD CLASSIFIER CLASSIFIER-1 WITH
273+
( WORKLOAD_GROUP = 'wgDataLoad'
274+
,MEMBERNAME = 'USER-1'
275+
,WLM_LABEL = 'dimension_loads'
276+
,IMPORTANCE = 'High');
277+
278+
CREATE WORKLOAD CLASSIFIER CLASSIFIER-2 WITH
279+
( WORKLOAD_GROUP = 'wgUserqueries'
280+
,MEMBERNAME = 'USER-1'
281+
,WLM_LABEL = 'dimension_loads'
282+
,IMPORTANCE = 'High');
283+
```
284+
285+
If a user runs a query with `OPTION (LABEL = 'dimension_loads')`, both the classifiers have a tie as the query meets criteria for both. When user submits the query, consider the scenario where five concurrent queries are getting executed in the `wgUserqueries` group and ten queries are getting executed in the `wgDataLoad` group. The user request will be routed to `wgUserqueries` group using `CLASSIFIER-2`, as the `wgUserqueries` workload group has higher available concurrency at the time the user submitted a query.
286+
287287
3. Next, the importance setting of the request is considered for tie-breakers. If there was a tie in workload classification using precedence rules, the request will be routed to workload group that has highest importance. For more information, see [workload importance](sql-data-warehouse-workload-importance.md).
288288

289289
4. Finally, the creation time of the workload group is considered for tie-breakers. The user request will be routed to the workload group that was created most recently.
290290

291-
292-
## Next steps
293-
- For more information on workload classification, see [Workload Classification](sql-data-warehouse-workload-classification.md).
294-
- For more information on workload importance, see [Workload Importance](sql-data-warehouse-workload-importance.md)
291+
## Next step
295292

296293
> [!div class="nextstepaction"]
297-
> [Go to Configure Workload Importance](sql-data-warehouse-how-to-configure-workload-importance.md)
298-
294+
> [Configure Workload Importance](sql-data-warehouse-how-to-configure-workload-importance.md)
295+
296+
## Related content
297+
298+
- For more information on workload classification, see [Workload Classification](sql-data-warehouse-workload-classification.md).
299+
- For more information on workload importance, see [Workload Importance](sql-data-warehouse-workload-importance.md).
300+

0 commit comments

Comments
 (0)