Always ON – Max DOP for Secondary

Environment

-> JBSUB-PRIMARY and JBSUB-DR are Azure IaaS virtual machines provisioned on East US region.

-> Azure virtual machine JBSUB-PRIMARY and JBSUB-DR are part of Windows cluster JBSWikiClust without shared storage. Azure virtual machine JBSUB-PRIMARY and JBSUB-DR will be configured using Synchronous commit with automatic failover.

-> We had a requirement wherein MAXDOP value should be set to 1 in primary replica and MAXDOP value should be 0 on secondary replica.

-> The problem arises on above requirement when a failover is performed and the MAXDOP value for each of these 2 replicas are set at instance level. After the failover New primary will have MAXDOP as 0 and New Secondary with MAXDOP1 and this causes performance issues in our application.

-> Database option “Max DOP for Secondary” came to rescue, where in we were able to specify the MAXDOP value for Primary and secondary replica as below,

Primary Replica JBSUB-PRIMARY

select @@servername
go
sp_configure 'max degree of parallelism'

-> Then execute below user query,

select top 100000 * from [dbo].[Table3] a INNER JOIN Table2 b ON a.sno=a.sno 
order by b.sname

Secondary Replica JBSUB-DR using Read-Routing List

select @@servername
go
sp_configure 'max degree of parallelism'

-> Then execute below user query,

select top 100000 * from [dbo].[Table3] a INNER JOIN Table2 b ON a.sno=a.sno 
order by b.sname

Secondary Replica JBSUB-DR directly using SQL Server Instance

select @@servername
go
sp_configure 'max degree of parallelism'

-> Then execute below user query,

select top 100000 * from [dbo].[Table3] a INNER JOIN Table2 b ON a.sno=a.sno 
order by b.sname

Hope this help!!!

Thank You,
Vivek Janakiraman

Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.