Friday, February 10, 2017

Microsoft Dynamics CRM On-Premise Performance Testing

 

My colleague Eric Regnier has done some great work on CRM Performance Testing and would like to share what he shared with me….

For SQL Server indexing and tuning:

  1. Query Tuning: http://technet.microsoft.com/en-us/library/cc917579.aspx
  2. Understanding and resolving Microsoft SQL Server blocking: http://support.microsoft.com/kb/224453
  3. Optimizing Microsoft SQL Server Performance: http://support.microsoft.com/kb/110352/en-us
  4. SQL Server Clustered Indexing Best Practices: http://technet.microsoft.com/library/Cc917672
  5. Improving SQL Server Performance: http://msdn.microsoft.com/en-us/library/ff647793.aspx

CRM SDK call. i.e. when you do Data Migration jobs. Some of those might or might not increase perf:

  1. Leverage ExecuteTransactionRequest as much as possible for dependent records otherwise use ExecuteMultipleRequest
  2. Generate GUIDs of parent records within console instead letting CRM generate the GUIDs. This way will allow the script to create parent and child records in one transaction and reduce the complexity to O(n).
  3. Increase multiple request batch size to 2000 instead of 800. Requires PowerShell https://msdn.microsoft.com/en-us/library/gg334634.aspx. Should be put back to 1000 afterwards.
  4. Split console by entities. One Console per entity. I was able to achieve over 500000 per hour in a previous project with that way.
  5. Set the regarding field of the email once all emails were created in the system. 1st create emails then 2nd update Regarding
  6. Turn off database replication during DM

Network:

  1. Run the CRM Diag tool: <CRMUrl>/tools/diagnostics/diag.aspx

Web Server(s):

1. Only single Async CRM Server is running. Should be able to increase performance by having multiple async servers.

2. Enable the EnableRetrieveMultipleOptimization registry key

3. WCF Compression enabled

4. CRM SSL enabled

5. IIS Dynamic Compression is enabled

6. IIS system.web\caching\outputCaching omitVaryStar setting enabled (https://blogs.msdn.microsoft.com/crminthefield/2014/12/19/static-content-not-cached-properly-in-dynamics-crm-due-to-vary-header)

7. AsyncOperationBase is truncated/cleared?

8. Anti-virus excludes CRM or disabled

9. F5 load balancer compression enabled

CRM:

  1. Review Parental and Cascade All entity relationships settings for entities.
  2. Review the usage of Sharing. In custom workflow activities and plugins.
  3. Sharing with previous owner system setting off
  4. Disable workflow job retention logs from processes and plugins. This will help reduce the asyncoperation table.
  5. Review Business Rule scope configuration that are set to Entity. These will trigger at platform level.
  6. Review CRM traces and all frontend and backend servers:
    1. Sandbox logs and server level logs. Recommendation: Set at Errors only.
  7. Purge and review log configuration:
    1. Custom log entities and custom logs (e.g. NLog)
    2. Custom staging entities
    3. asyncoperation table
  8. Review audit settings. Only required entities and fields.
  9. Review Find Columns of Quick Find Views. Recommendation: max 10 fields per entities
  10. Review plugins on Retrieve if applicable
  11. Review form load performance with CRM Performance Center (CTRL+Shift+Q). Recommendation
    1. Tabs collapsed by default will increase load time
    2. No BPF. BPF take a lot of time to load
    3. Use subgrid when necessary and leverage associated grids in navigation instead.

Articles:

https://www.microsoft.com/en-au/download/details.aspx?id=27139

http://blog.craigharvey.me/2015/03/02/dynamics-crm-performance-troubleshooting/

https://blogs.msdn.microsoft.com/crminthefield/2011/06/09/principalobjectaccessperformance-recommendations/

https://blogs.msdn.microsoft.com/crminthefield/2014/07/14/using-performance-analyzer-for-microsoft-dynamics-dynamicsperf-in-a-development-test-or-qa-environment/ à https://dynamicsperf.codeplex.com/

http://blog.cobalt.net/blog/understanding-the-microsoft-dynamics-crm-performance-center