You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-how-to-troubleshoot-missed-classification.md
+91-89Lines changed: 91 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,15 @@ description: Identify and troubleshoot scenarios where workloads are misclassifi
4
4
author: WilliamDAssafMSFT
5
5
ms.author: wiassaf
6
6
ms.reviewer: wiassaf
7
-
ms.date: 03/09/2022
7
+
ms.date: 07/29/2024
8
8
ms.service: synapse-analytics
9
9
ms.subservice: sql-dw
10
10
ms.topic: how-to
11
-
ms.custom: template-how-to
11
+
ms.custom:
12
+
- template-how-to
12
13
---
13
14
14
-
# Troubleshooting a misclassified workload in Azure Synapse Analytics
15
+
# Troubleshoot a misclassified workload in Azure Synapse Analytics
15
16
16
17
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.
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.
21
22
22
23
> [!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).
24
27
25
28
## Basic troubleshooting information
26
29
@@ -44,7 +47,7 @@ To get a list of all workload groups (including system workload groups) and asso
44
47
1. In the left side pane, select **Workload management** under **Settings**.
45
48
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**.
46
49
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.":::
48
51
49
52
#### T-SQL
50
53
@@ -63,7 +66,7 @@ For more information, see [sys.workload_management_workload_groups](/sql/relatio
63
66
64
67
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).
65
68
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":::
67
70
68
71
#### T-SQL
69
72
@@ -110,7 +113,7 @@ Consider following scenario:
110
113
111
114
1. A database user, DBAUser, is assigned to largerc resource class role using `sp_addrolemember` procedure.
112
115
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 newlycreated workload classifier maps database role DBARole to mediumrc resource class with high importance.
114
117
1. DBAUser is a made a member of the DBARole database role.
115
118
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.
### Some administrative users are always mapped to smallrc workload group
134
137
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.
136
139
137
140
**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.
138
141
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.
144
143
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).
145
145
146
146
### Use workload group precedence for better classification
147
147
@@ -157,9 +157,9 @@ In scenarios where resource classes are being used it's best to create a dedicat
157
157
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.
158
158
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.
159
159
160
-
#### If Workload Management Capabilities are used
160
+
#### If workload management capabilities are used
161
161
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:
163
163
164
164
|**Classifier parameter**|**Weight**|
165
165
|---------------------|---------|
@@ -186,7 +186,7 @@ CREATE WORKLOAD CLASSIFIER CLASSIFIER-2 WITH
186
186
,IMPORTANCE ='Low')
187
187
```
188
188
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`).
190
190
191
191
For more information on workload classification, see [classification weighting](sql-data-warehouse-workload-classification.md#classification-weighting) and [query labels](../sql/develop-label.md).
192
192
@@ -214,85 +214,87 @@ If a user runs a query with `OPTION (LABEL = 'dimension_loads')`, it can be clas
214
214
215
215
If there was a tie in workload groups or classifiers, following precedence takes effect:
216
216
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 )
218
228
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.
220
250
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
-
251
251
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
+
287
287
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).
288
288
289
289
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.
290
290
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
295
292
296
293
> [!div class="nextstepaction"]
297
-
> [Go to Configure Workload Importance](sql-data-warehouse-how-to-configure-workload-importance.md)
0 commit comments