One of our customers is adding many new users to Dynamics CRM system almost every month. As the number of CRM users increased, they are starting to see more alerts from their load balancer F5 indicates that IIS is not responding. After some investigation, it appears the issues are related to requests that have been queued in IIS and are waiting on responses from SQL. Based on our prior recommendation, they used DynamicsPerf to identify their performance bottleneck.
Finding Performance Bottleneck
Performance Analyzer for Microsoft Dynamics is a toolset developed by Premier Field Engineering at Microsoft. The toolset is designed to collect SQL Server Data Management Views (DMVs) and Microsoft Dynamics data into a singular database called DynamicsPerf. This tool helps customers to identify performance issues on Microsoft Dynamics products (CRM, AX, GP, NAV, SL).
Using DynamicsPerf, they found their most expensive query is related to email tagging:
DISTINCT top 51 “email0”.ModifiedOn as “modifiedon”, “email0”.MessageId as “messageid”, “email0”.ActivityId as “activityid”,
“email0”.RegardingObjectId as “regardingobjectid”, “email0”.Subject as “subject”, “email0”.RegardingObjectIdYomiName as “regardingobjectidyominame”,
“email0”.RegardingObjectIdName as “regardingobjectidname”, “email0”.RegardingObjectTypeCode as “regardingobjecttypecode”
Email as “email0” join ActivityParty as “activityparty1” on (“email0”.ActivityId = “activityparty1”.ActivityId and ((“activityparty1”.PartyId = @PartyId0)))
(( “email0”.ModifiedOn >= @ModifiedOn0 and “email0”.MessageId is not null))
“email0”.MessageId asc, “email0”.ActivityId asc
Fig 1. Performance statistics
With performance bottleneck identified, what should you do next?
Enable or Disable Email Tagging
In CRM 2011 and 2013, email tagging is enabled by default. However, some customers may not need email tagged to be turned on. It is important to review your environment and see if you really need to have email tagging enabled. There are two scenarios that enabling email tagging is useful. If they don’t apply to your environment, then consider to turn off email tagging to improve performance.
So what are the two scenarios? Our colleague, Aaron Richards, provided great information in his article–CRM E-mail Tracking: Part 3- Tagging Deep Dive:
1. When the user record (Settings| Administration| Users) is set to use the Email Router. When using the Email Router for incoming and outgoing emails, the CRM for Outlook client cannot tell whether or not the emails should be tracked, as they are routed through the Email Router for tracking instead. Since the tagging process’s main goal is to retrieve changes to emails from the CRM Server and bring them to the CRM for Outlook client, tagging will see that these emails have been added to or changed in CRM and that they should be tracked when requesting records from the CRM Server and it will then pull down these change to the CRM for Outlook client to show these emails as tracked.
2. The second scenario is where the System Settings (Settings| Administration | System Settings) “Track e-mails sent between CRM users as two activities” is not marked. If two CRM users are included on an email, each user has the option to track this into CRM. Now, if User1 tracks this to a specific record (Record A), the Set Regarding record will then be updated on the CRM Server for that email. However, if User2 tracks this email from their CRM for Outlook client and sets the regarding to a different record in CRM (Record B), this will update the Set Regarding for the same email record on the CRM Server. If tagging is enabled on User1’s CRM for Outlook client, this set regarding change will roll down to User1’s email in their CRM for Outlook client and they will now see this Set Regarding to Record B.
For the first scenario, it mentioned Email Router for Incoming and Outgoing emails. If you are using server side sync for emails, your tracked emails should show as tracked with email tagging off. So if a user sends an email from within CRM it would show as tracked even if you turned off email tagging.
After reviewed Aaron Richards’ article and their environment, our customer decided that they are safe to disable email tagging. So they are planning to start to implement this with a small group of users, then roll out to all CRM users.
Client Side Change
Our customer wondered how to make this change for their users. Email tagging setting is determined by client side registry keys. It is not a server side setting. So they will need to roll this out to their CRM users via Group Policy. This applied to CRM 2011 and 2013. Again, you can find more detailed information from Aaron Richards’ article–CRM E-mail Tracking: Part 3- Tagging Deep Dive.
Some customers are asking why not make email tagged disabled by default? That is being considered as an enhancement for future release.
Hope this article is helpful. Thanks everyone!