Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1201739%22%20slang%3D%22en-US%22%3EConfiguring%20Workload%20Isolation%20in%20Azure%20Synapse%20Analytics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1201739%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20working%20with%20a%20FastTrack%20customer%20recently%20on%20setting%20up%20their%20Azure%20Synapse%20Analytics%20environment.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20customer%20asked%20a%20question%20about%20the%20best%20way%20to%20utilize%20resource%20classes%20to%20ensure%20that%20logins%20for%20specific%20tasks%20were%20given%20the%20appropriate%20level%20of%20resources%20to%20support%20the%20tasks%20they%20need%20to%20process%20on%20the%20system.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EInstead%20of%20reviewing%20resource%20classes%20I%20recommended%20that%20we%20examine%20one%20of%20the%20new%20Azure%20Synapse%20features%2C%20Workload%20Isolation.%26nbsp%3B%20Workload%20Isolation%20allows%20you%20to%20create%20your%20own%20resource%20limitations%2C%20caps%2C%20workload%20importance%2C%20minimums%20per%20connection%2C%20and%20bind%20them%20to%20individual%20logins.%26nbsp%3B%20This%20approach%20offers%20much%20more%20flexibility%20for%20user%20configurations.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20ever%20set%20up%20resource%20governance%20in%20SQL%20Server%20then%20this%20concept%20will%20be%20very%20similar%20to%20you%2C%20essentially%20we%20were%20creating%20Workload%20Groups%20with%20a%20specific%20amount%20of%20dedicated%20resources%20to%20ensure%20they%20can%20maximize%20the%20power%20of%20Azure%20Synapse%20and%20then%20binding%20those%20Workload%20Groups%20to%20Workload%20Classifiers%20so%20a%20login%20can%20be%20bound%20to%20a%20specified%20Workload%20Group.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20start%20by%20working%20through%20a%20scenario.%26nbsp%3B%20Let%20us%20say%20that%20our%20Azure%20Synapse%20database%20will%20be%20utilized%20by%20the%20following%20login%20names%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPowerBIUser%20%E2%80%93%20Users%20running%20Power%20BI%20reports%20use%20this%20login%20to%20query%20data%20against%20our%20Azure%20Synapse%20database.%3C%2FLI%3E%0A%3CLI%3EAASProcessing%20%E2%80%93%20This%20user%20runs%20our%20Azure%20Analysis%20Services%20cube%20processing.%3C%2FLI%3E%0A%3CLI%3EPBDataLoad%20%E2%80%93%20This%20user%20runs%20data%20loading%20from%20our%20Azure%20Data%20Lake%20to%20Azure%20Synapse%20using%20Polybase.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EFirst%2C%20I%20want%20to%20validate%20those%20are%20the%20only%20users%20on%20the%20system%20and%20look%20for%20any%20other%20users%20to%20consider.%26nbsp%3B%20For%20Workload%20Isolation%20to%20perform%20at%20its%20most%20optimum%20level%20all%20logins%20on%20an%20Azure%20Synapse%20SQL%20Pool%20should%20be%20part%20of%20the%20system.%26nbsp%3B%20We%20will%20validate%20the%20users%20using%20the%20following%20script%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESELECT%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20dp2.name%20as%20'User%20Name'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cdp1.name%20as%20'Role%20Name'%3C%2FP%3E%0A%3CP%3EFROM%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20sys.database_role_members%20drm%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20LEFT%20JOIN%20sys.database_principals%20dp1%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ON%20drm.role_principal_id%3Ddp1.principal_id%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20LEFT%20JOIN%20sys.database_principals%20dp2%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ON%20drm.member_principal_id%3Ddp2.principal_id%3C%2FP%3E%0A%3CP%3EWHERE%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20dp2.type_desc%26lt%3B%26gt%3B'DATABASE_ROLE'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20AND%20drm.role_principal_id%20%26lt%3B%2016384%3C%2FP%3E%0A%3CP%3EORDER%20BY%20dp2.name%20desc%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workload%20isolation%2001.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F174206i6384E11A7D541EE5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workload%20isolation%2001.PNG%22%20alt%3D%22Workload%20isolation%2001.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20this%20gives%20us%20the%20users%20names%20for%20my%20SQL%20Pool%20as%20well%20as%20their%20current%20roles.%26nbsp%3B%20Next%2C%20I%20want%20to%20understand%20what%20the%20resources%20are%20for%20the%20current%20roles.%26nbsp%3B%20Let%E2%80%99s%20do%20that%20by%20expanding%20our%20query%20to%20add%20the%20DMV%20sys.dm_workload_management_workload_groups_stats%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESELECT%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20dp2.name%20as%20'User%20Name'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cdp1.name%20as%20'Role%20Name'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cwmwg.effective_min_percentage_resource%20as%20'Min%25'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cwmwg.effective_cap_percentage_resource%20as%20'Cap'%3C%2FP%3E%0A%3CP%3E%2Cwmwg.effective_request_min_resource_grant_percent%20'MinGrant%25'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cwmwg.%20effective_request_max_resource_grant_percent%20as%20'Max%25'%3C%2FP%3E%0A%3CP%3EFROM%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20sys.database_role_members%20drm%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20LEFT%20JOIN%20sys.database_principals%20dp1%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ON%20drm.role_principal_id%3Ddp1.principal_id%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20LEFT%20JOIN%20sys.database_principals%20dp2%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ON%20drm.member_principal_id%3Ddp2.principal_id%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20LEFT%20JOIN%20sys.dm_workload_management_workload_groups_stats%20wmwg%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20on%20dp1.name%20%3D%20wmwg.name%3C%2FP%3E%0A%3CP%3EWHERE%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20dp2.type_desc%26lt%3B%26gt%3B'DATABASE_ROLE'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20AND%20drm.role_principal_id%20%26lt%3B%2016384%3C%2FP%3E%0A%3CP%3EORDER%20BY%20dp2.name%20desc%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workload%20isolation%2002.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F174208i0F39D319D61DA4C3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workload%20isolation%2002.PNG%22%20alt%3D%22Workload%20isolation%2002.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20can%20now%20see%20the%20effective%20minimum%2C%20minimum%20grant%20percent%2C%20max%20percent%2C%20and%20the%20cap%20for%20the%20resource.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20would%20like%20my%20percentages%20to%20total%20up%20to%20100%25%20so%20I%20can%20sustain%20a%20global%20Power%20BI%20user%20community%2C%20additional%20cube%20processing%20tasks%2C%20and%20more%20frequent%20incremental%20data%20loading.%26nbsp%3B%20To%20do%20so%20I%E2%80%99m%20going%20to%20add%20the%20following%20resource%20caps%3B%20Power%20BI%2030%25%2C%20DataLoad%2022%25%2C%20and%20AASProcess%2048%25%20which%20totals%20up%20to%20100%25.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20we%20will%20create%20the%20Workload%20Groups%20with%20the%20following%20script%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECREATE%20WORKLOAD%20GROUP%20PowerBI%20WITH%3C%2FP%3E%0A%3CP%3E(%20MIN_PERCENTAGE_RESOURCE%20%3D%2020%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20--%20integer%20value%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CREQUEST_MIN_RESOURCE_GRANT_PERCENT%20%3D%202.5%20--%20factor%20of%2020%20(guaranteed%20a%20minimum%20of%208%20concurrency)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CCAP_PERCENTAGE_RESOURCE%20%3D%2030%20)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECREATE%20WORKLOAD%20GROUP%20DataLoad%20WITH%3C%2FP%3E%0A%3CP%3E(%20MIN_PERCENTAGE_RESOURCE%20%3D%2011%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20--%20integer%20value%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CREQUEST_MIN_RESOURCE_GRANT_PERCENT%20%3D%2011%20--%20factor%20of%2011%20(guaranteed%20a%20minimum%20of%202%20concurrency)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CCAP_PERCENTAGE_RESOURCE%20%3D%2022%20)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BCREATE%20WORKLOAD%20GROUP%20AASProcess%20WITH%3C%2FP%3E%0A%3CP%3E(%20MIN_PERCENTAGE_RESOURCE%20%3D%2048%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20--%20integer%20value%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CREQUEST_MIN_RESOURCE_GRANT_PERCENT%20%3D%2024%20--%20factor%20of%2048%20(guaranteed%20a%20minimum%20of%202%20concurrency)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CCAP_PERCENTAGE_RESOURCE%20%3D%2048%20)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20we%20create%20our%20Workload%20Groups%2C%20we%20need%20to%20bind%20these%20groups%20to%20our%20logins%20using%20a%20classifier.%26nbsp%3B%20We%20will%20do%20this%20with%20the%20following%20script%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECREATE%20WORKLOAD%20CLASSIFIER%20PowerBIWC%20WITH%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(%20WORKLOAD_GROUP%20%3D%20'PowerBI'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CMEMBERNAME%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20'PowerBIUser'%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BCREATE%20WORKLOAD%20CLASSIFIER%20DataLoadWC%20WITH%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(%20WORKLOAD_GROUP%20%3D%20'DataLoad'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CMEMBERNAME%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20'PBDataLoad'%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3BCREATE%20WORKLOAD%20CLASSIFIER%20AASProcessWC%20WITH%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(%20WORKLOAD_GROUP%20%3D%20'AASProcess'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%2CMEMBERNAME%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20'AASProcessing'%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20)%3C%2FP%3E%0A%3CP%3ENow%20let%E2%80%99s%20run%20a%20query%20against%20our%20DMV%20sys.dm_workload_management_workload_groups_stats%20to%20see%20our%20new%20Workload%20Groups%20and%20their%20allocations%20next%20to%20the%20standard%20Resource%20Classes.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eselect%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20wmwg.name%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cwmwg.effective_min_percentage_resource%20as%20'Min%25'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cwmwg.effective_cap_percentage_resource%20as%20'Cap'%3C%2FP%3E%0A%3CP%3E%2Cwmwg.effective_request_min_resource_grant_percent%20'MinGrant%25'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cwmwg.%20effective_request_max_resource_grant_percent%20as%20'Max%25'%3C%2FP%3E%0A%3CP%3Efrom%3C%2FP%3E%0A%3CP%3E%26nbsp%3Bsys.dm_workload_management_workload_groups_stats%20wmwg%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workload%20isolation%2003.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F174209i04269748F722A008%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workload%20isolation%2003.PNG%22%20alt%3D%22Workload%20isolation%2003.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOur%20new%20process%20is%20listed%20and%20ready%20to%20go.%26nbsp%3B%20Now%20let%E2%80%99s%20test%20this%20out.%26nbsp%3B%20I%E2%80%99m%20going%20to%20kick%20off%20my%20different%20processes%20and%20then%20we%20will%20run%20the%20following%20query%20to%20validate%20the%20resource%20usage.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESELECT%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20resource_class%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cimportance%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cgroup_name%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cclassifier_name%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2Cresource_allocation_percentage%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2C*%3C%2FP%3E%0A%3CP%3EFROM%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SYS.DM_PDW_EXEC_REQUESTS%3C%2FP%3E%0A%3CP%3EWHERE%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20STATUS%3D'RUNNING'%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Workload%20isolation%2004.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F174210i6C7D67F7346FE9F9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Workload%20isolation%2004.PNG%22%20alt%3D%22Workload%20isolation%2004.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EPerfect!%26nbsp%3B%20We%20can%20see%20as%20these%20processes%20are%20executing%20that%20the%20percentages%2C%20we%20defined%20are%20the%20same%20as%20those%20that%20are%20running%20on%20our%20system.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20question%20you%20may%20ask%20is%20%E2%80%98What%20about%20the%20previous%20Resource%20Class%20definitions%3F%26nbsp%3B%20Shouldn%E2%80%99t%20we%20remove%20them%20from%20the%20logins%3F%E2%80%99.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHow%20very%20perceptive%20of%20you%20Dear%20Reader.%26nbsp%3B%20The%20reason%20I%20left%20them%20in%20place%20is%2C%20should%20I%20need%20to%20change%20my%20Workload%20Groups%20I%20would%20need%20to%20first%20drop%20the%20Classifier%2C%20then%20the%20Workload%20Group%2C%20then%20re-create%20the%20Workload%20Group.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Workload%20Group%20cannot%20be%20dropped%20while%20active%20transactions%20utilizing%20that%20Workload%20Group%20have%20completed.%26nbsp%3B%20If%20I%20want%20to%20alter%20the%20group%20and%20a%20process%20is%20running%20during%20that%20time%2C%20if%20I%20dropped%20the%20previous%20Resource%20Classes%2C%20then%20each%20new%20process%20would%20inherit%20the%20default%20Resource%20Class%20of%20smallrc.%26nbsp%3B%20The%20smallrc%20only%20grants%205%25%20of%20resources%20to%20a%20login.%26nbsp%3B%20That%20may%20be%20ok%20for%20my%20Power%20BI%20users%2C%20but%20not%20for%20my%20PBDataLoad%20or%20AASCubeProcessing%20users.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20very%20much%20for%20reading%2C%20now%20go%20forth%20and%20begin%20working%20with%20Workload%20Isolation!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1201739%22%20slang%3D%22en-US%22%3E%3CP%3EA%20quick%20reference%20for%20setting%20up%20and%20configuring%20Workload%20Isolation%20for%20Azure%20Synapse%20Analytics%20SQL%20Pools.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22Ignite%204.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F174205iEE5718297B015E82%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Ignite%204.PNG%22%20alt%3D%22Ignite%204.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E

I was working with a FastTrack customer recently on setting up their Azure Synapse Analytics environment. 

 

The customer asked a question about the best way to utilize resource classes to ensure that logins for specific tasks were given the appropriate level of resources to support the tasks they need to process on the system.

 

Instead of reviewing resource classes I recommended that we examine one of the new Azure Synapse features, Workload Isolation.  Workload Isolation allows you to create your own resource limitations, caps, workload importance, minimums per connection, and bind them to individual logins.  This approach offers much more flexibility for user configurations.

 

If you have ever set up resource governance in SQL Server then this concept will be very similar to you, essentially we were creating Workload Groups with a specific amount of dedicated resources to ensure they can maximize the power of Azure Synapse and then binding those Workload Groups to Workload Classifiers so a login can be bound to a specified Workload Group.

 

Let’s start by working through a scenario.  Let us say that our Azure Synapse database will be utilized by the following login names:

  • PowerBIUser – Users running Power BI reports use this login to query data against our Azure Synapse database.
  • AASProcessing – This user runs our Azure Analysis Services cube processing.
  • PBDataLoad – This user runs data loading from our Azure Data Lake to Azure Synapse using Polybase.

First, I want to validate those are the only users on the system and look for any other users to consider.  For Workload Isolation to perform at its most optimum level all logins on an Azure Synapse SQL Pool should be part of the system.  We will validate the users using the following script:

 

SELECT

       dp2.name as 'User Name'

       ,dp1.name as 'Role Name'

FROM

       sys.database_role_members drm

       LEFT JOIN sys.database_principals dp1

       ON drm.role_principal_id=dp1.principal_id

       LEFT JOIN sys.database_principals dp2

       ON drm.member_principal_id=dp2.principal_id

WHERE

       dp2.type_desc<>'DATABASE_ROLE'

       AND drm.role_principal_id < 16384

ORDER BY dp2.name desc

 

Workload isolation 01.PNG

 

As you can see this gives us the users names for my SQL Pool as well as their current roles.  Next, I want to understand what the resources are for the current roles.  Let’s do that by expanding our query to add the DMV sys.dm_workload_management_workload_groups_stats:

 

SELECT

       dp2.name as 'User Name'

       ,dp1.name as 'Role Name'

       ,wmwg.effective_min_percentage_resource as 'Min%'

       ,wmwg.effective_cap_percentage_resource as 'Cap'

,wmwg.effective_request_min_resource_grant_percent 'MinGrant%'

       ,wmwg. effective_request_max_resource_grant_percent as 'Max%'

FROM

       sys.database_role_members drm

       LEFT JOIN sys.database_principals dp1

       ON drm.role_principal_id=dp1.principal_id

       LEFT JOIN sys.database_principals dp2

       ON drm.member_principal_id=dp2.principal_id

       LEFT JOIN sys.dm_workload_management_workload_groups_stats wmwg

       on dp1.name = wmwg.name

WHERE

       dp2.type_desc<>'DATABASE_ROLE'

       AND drm.role_principal_id < 16384

ORDER BY dp2.name desc

 

Workload isolation 02.PNG

 

We can now see the effective minimum, minimum grant percent, max percent, and the cap for the resource. 

 

I would like my percentages to total up to 100% so I can sustain a global Power BI user community, additional cube processing tasks, and more frequent incremental data loading.  To do so I’m going to add the following resource caps; Power BI 30%, DataLoad 22%, and AASProcess 48% which totals up to 100%.

 

First, we will create the Workload Groups with the following script:

 

CREATE WORKLOAD GROUP PowerBI WITH

( MIN_PERCENTAGE_RESOURCE = 20              -- integer value

 ,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 2.5 -- factor of 20 (guaranteed a minimum of 8 concurrency)

 ,CAP_PERCENTAGE_RESOURCE = 30 )

 

CREATE WORKLOAD GROUP DataLoad WITH

( MIN_PERCENTAGE_RESOURCE = 11              -- integer value

 ,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 11 -- factor of 11 (guaranteed a minimum of 2 concurrency)

 ,CAP_PERCENTAGE_RESOURCE = 22 )

 

 CREATE WORKLOAD GROUP AASProcess WITH

( MIN_PERCENTAGE_RESOURCE = 48              -- integer value

 ,REQUEST_MIN_RESOURCE_GRANT_PERCENT = 24 -- factor of 48 (guaranteed a minimum of 2 concurrency)

 ,CAP_PERCENTAGE_RESOURCE = 48 )

 

After we create our Workload Groups, we need to bind these groups to our logins using a classifier.  We will do this with the following script:

 

CREATE WORKLOAD CLASSIFIER PowerBIWC WITH 

( WORKLOAD_GROUP = 'PowerBI'

 ,MEMBERNAME     = 'PowerBIUser' 

  )

 

 CREATE WORKLOAD CLASSIFIER DataLoadWC WITH 

( WORKLOAD_GROUP = 'DataLoad'

 ,MEMBERNAME     = 'PBDataLoad' 

  )

 

 CREATE WORKLOAD CLASSIFIER AASProcessWC WITH 

( WORKLOAD_GROUP = 'AASProcess'

 ,MEMBERNAME     = 'AASProcessing' 

  )

Now let’s run a query against our DMV sys.dm_workload_management_workload_groups_stats to see our new Workload Groups and their allocations next to the standard Resource Classes.

 

select

       wmwg.name

       ,wmwg.effective_min_percentage_resource as 'Min%'

       ,wmwg.effective_cap_percentage_resource as 'Cap'

,wmwg.effective_request_min_resource_grant_percent 'MinGrant%'

       ,wmwg. effective_request_max_resource_grant_percent as 'Max%'

from

 sys.dm_workload_management_workload_groups_stats wmwg

 

Workload isolation 03.PNG

Our new process is listed and ready to go.  Now let’s test this out.  I’m going to kick off my different processes and then we will run the following query to validate the resource usage.

 

SELECT

       resource_class

       ,importance

       ,group_name

       ,classifier_name

       ,resource_allocation_percentage

       ,*

FROM

       SYS.DM_PDW_EXEC_REQUESTS

WHERE

       STATUS='RUNNING'

 

Workload isolation 04.PNG

Perfect!  We can see as these processes are executing that the percentages, we defined are the same as those that are running on our system.

 

One question you may ask is ‘What about the previous Resource Class definitions?  Shouldn’t we remove them from the logins?’.

 

How very perceptive of you Dear Reader.  The reason I left them in place is, should I need to change my Workload Groups I would need to first drop the Classifier, then the Workload Group, then re-create the Workload Group.

 

The Workload Group cannot be dropped while active transactions utilizing that Workload Group have completed.  If I want to alter the group and a process is running during that time, if I dropped the previous Resource Classes, then each new process would inherit the default Resource Class of smallrc.  The smallrc only grants 5% of resources to a login.  That may be ok for my Power BI users, but not for my PBDataLoad or AASCubeProcessing users.

 

Thanks very much for reading, now go forth and begin working with Workload Isolation!