Just recently completed an upgrade (backup, restore) from Dynamics 2013 -> 2015 -> 2016 update 1.
As part of the upgrade we also went from SQL 2012 to SQL 2016 Enterprise.
I've applied the settings as per https://technet.microsoft.com/en-us/library/hh699783.aspx#sql2016_perf (trace flag 1224, TARGET_RECOVERY_TIME = 60). Also, MAXDOP = 1, dedicated 16GB VM with 4 cores, 12GB max SQL server memory, Server 2012 R2 Datacenter, fast SSD.
Performance is generally acceptable, but for large portions of the day where there is a lot of traffic on the site (~100 users), the CPU usage on the SQL server tends to be quite high (70 - 90%). Then sometimes it will drop down and just sit at 25%, other times it will sit at the (expected and what I've observed in the past) 2-15%.
At the higher CPU utilization, the site does become noticeably sluggish.
The big problem, that may be related, is that some custom SSRS reports published to CRM will timeout for some users depending on their security roles, which is odd. The only error is in the application log: Report render failure. Error: Thread was being aborted.
Now, the SQL expensive queries often shows this as the worst offender (very high Logical Reads/sec):
insert into @t (ObjectId) select distinct POA.ObjectId from PrincipalObjectAccess POA WITH (NOLOCK) join SystemUserPrincipals sup WITH (NOLOCK) on POA.PrincipalId = sup.Princi
Out PrincipalObjectAccess table has about ~700k rows, so a lot of record sharing and ownership teams, but never did we have any SQL performance issues on 2013.
Any idea or where to start looking?
*This post is locked for comments