Home
%3CLINGO-SUB%20id%3D%22lingo-sub-749776%22%20slang%3D%22en-US%22%3ELesson%20Learned%20%23100%3A%20How%20to%20monitor%20the%20queries%20when%20you%20are%20using%20Read%20Scale%20Out%20feature%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749776%22%20slang%3D%22en-US%22%3E%3CP%3EDuring%20these%20last%20days%20we%20received%20multiple%20questions%20abouts%20how%20to%20monitor%20the%20performance%20and%20the%20queries%20that%20were%20executed%20in%20the%20secondaries%20replicas%20using%20in%20the%20connection%20string%26nbsp%3BApplicationIntent%3DREADONLY%26nbsp%3Bwith%20Read%20Scale%20Out%20feature.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20article%20we%20explained%20time%20ago%20that%20is%20a%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Database-Support-Blog%2FLesson-Learned-65-Azure-SQL-Database-8211-Using-Read-Scale-Out%2Fba-p%2F369170%22%20target%3D%22_self%22%3ERead%20Scale%20Out%20for%20Premium%20databases%3C%2FA%3E%26nbsp%3Band%20in%20this%20article%20we%20would%20like%20to%20show%20you%20some%20alternatives%20to%20monitor%20the%20queries%20and%20performance%20of%20your%20database.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20know%20Query%20Data%20Store%2C%20Extended%20Events%2C%20SQL%20Profiler%20and%20Audit%20features%20are%20not%20supported%20on%20the%20read-only%20replicas%2C%20so%20the%20way%20to%20monitor%20the%20replicas%20will%20be%20to%20use%20the%20available%20DMVs%2C%20such%20as%20%3CSTRONG%3Esys.dm_db_resource_stats%3C%2FSTRONG%3E.%20Using%20the%20DMVs%20seems%20to%20be%20the%20best%20option%20for%20these%20cases%2C%20further%20information%20can%20be%20found%20in%20the%20link%20below%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fazure%252Fsql-database%252Fsql-database-read-scale-out%2523monitoring-and-troubleshooting-read-only-replica%26amp%3Bdata%3D02%257C01%257CJmjurado%2540microsoft.com%257Cee32fc6342c747b3e8a008d705da2220%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636984306766266483%26amp%3Bsdata%3D0lCt7Ad%252FyjkYvmvC7TmKUFh4%252F1jZOWZ85dTtAmO6%252Fmc%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-read-scale-out%23monitoring-and-troubleshooting-read-only-replica%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20another%20hand%2C%20using%20this%20DMV%3A%20select%20*%20from%20sys.dm_db_resource_stats%20you%20could%20review%20the%20resources%20utilization.%20Also%2C%20if%20you%20need%20more%20information%2C%20in%20this%20URL%3A%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fgithub.com%252FJMNetwalker%252FMonGeoAzure%26amp%3Bdata%3D02%257C01%257CJmjurado%2540microsoft.com%257Cee32fc6342c747b3e8a008d705da2220%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636984306766266483%26amp%3Bsdata%3DWtg%252FOXfpM4RX7l7lGrbinsj%252BM5uRyG%252FS32WUUWeo3FU%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FJMNetwalker%2FMonGeoAzure%3C%2FA%3Eyou%20could%20have%20more%20ways%20to%20collect%20the%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20lesson%20learned%20working%20with%20ApplicationIntent%3DReadOnly%2C%20I%20found%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWhen%20you%20have%20configured%20in%20your%20connectionstring%20ApplicationIntent%3DReadOnly%20the%20load%20balancing%20will%20enroute%20the%20connection%20to%20any%20of%20the%20two%20replicas%20that%20you%20have.%3C%2FLI%3E%0A%3CLI%3EThere%20is%20not%20possible%20to%20specify%201%20or%202%20at%20this%20time.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EThe%20primary%20replica%20is%20also%20eligible%20even%20when%20you%20have%20ApplicationIntent%3DReadOnly%26nbsp%3B%20in%20your%20connection%20string.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnjoy!!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-749776%22%20slang%3D%22en-US%22%3E%3CP%3EDuring%20these%20last%20days%20we%20received%20multiple%20questions%20abouts%20how%20to%20monitor%20the%20performance%20and%20the%20queries%20that%20were%20executed%20in%20the%20secondaries%20replicas%20using%20in%20the%20connection%20string%26nbsp%3BApplicationIntent%3DREADONLY%20with%20Read%20Scale%20Out%20feature.%3C%2FP%3E%0A%3CP%3EIn%20this%20article%20we%20are%20going%20to%20show%20some%20of%20them.%3C%2FP%3E%3C%2FLINGO-TEASER%3E

During these last days we received multiple questions abouts how to monitor the performance and the queries that were executed in the secondaries replicas using in the connection string ApplicationIntent=READONLY with Read Scale Out feature. 

 

In this article we explained time ago that is a Read Scale Out for Premium databases and in this article we would like to show you some alternatives to monitor the queries and performance of your database.

 

As you know Query Data Store, Extended Events, SQL Profiler and Audit features are not supported on the read-only replicas, so the way to monitor the replicas will be to use the available DMVs, such as sys.dm_db_resource_stats. Using the DMVs seems to be the best option for these cases, further information can be found in the link below: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-read-scale-out#monitoring-and-troub...

 

In another hand, using this DMV: select * from sys.dm_db_resource_stats you could review the resources utilization. Also, if you need more information, in this URL: https://github.com/JMNetwalker/MonGeoAzure you could have more ways to collect the data.

 

A lesson learned working with ApplicationIntent=ReadOnly, I found:

 

  • When you have configured in your connectionstring ApplicationIntent=ReadOnly the load balancing will enroute the connection to any of the two replicas that you have.
  • There is not possible to specify 1 or 2 at this time. 
  • The primary replica is also eligible even when you have ApplicationIntent=ReadOnly  in your connection string.

 

Enjoy!!