Query execution time of 30.0 seconds exceeded the threshold of 10 seconds RRS feed

  • Question

  • I see lot of these warnings in CRM 2011 (UR 11), this happened all of sudden, we never had this issue before.

    Can you suggest me what might be causing this and how to resolve this.

    Query execution time of 10.5 seconds exceeded the threshold of 10 seconds. Thread: 25; Database: Safety_Kleen_MSCRM; Server:sqlp111\sql11; Query: select 
    "activitymimeattachment0".FileName as "filename"
    , "activitymimeattachment0".ActivityMimeAttachmentId as "activitymimeattachmentid" 
     ActivityAttachment as "activitymimeattachment0" 
     (("activitymimeattachment0".ActivityId = '3e2eb078-5f6e-e411-9461-00155d8e9927') and ("activitymimeattachment0".ObjectId in (select Temp.TemplateId from Template Temp where Temp.IsPersonal = 0)  or "activitymimeattachment0".ActivityId in (select ObjectId from fn_POARetrieveMultiple('796bcd67-fd46-e111-abad-0050569877c4', 4200)) or ("activitymimeattachment0".ObjectTypeCode = 4202) or ("activitymimeattachment0".ObjectTypeCode = 4202 and "activitymimeattachment0".OwningBusinessUnit is not null) or ("activitymimeattachment0".OwnerId in (select PrincipalId from SystemUserPrincipals sup where sup.SystemUserId = '796bcd67-fd46-e111-abad-0050569877c4') and "activitymimeattachment0".ObjectTypeCode = 2010) or ("activitymimeattachment0".ObjectId in (select T.TemplateId from Template T  where T.IsPersonal = 1 and T.TemplateId in
    (select POA.ObjectId from PrincipalObjectAccess POA join SystemUserPrincipals sup on 
     POA.PrincipalId = sup.PrincipalId where sup.SystemUserId = '796bcd67-fd46-e111-abad-0050569877c4' and POA.ObjectTypeCode = 2010 and 
     ((POA.AccessRightsMask|POA.InheritedAccessRightsMask) & 1) = 1)
    ) and "activitymimeattachment0".ObjectTypeCode = 2010))).


    Tuesday, November 18, 2014 5:49 PM

All replies

  • There are a handful of timeout settings that can affect Dynamics CRM.  In most situations the default setting is sufficient for these and they don’t need to be changed, however, there are times (such as during an upgrade) when these might need to be adjusted to let a certain process complete, or if a user is waiting too long for a process only to fail in the end--these settings can be adjusted; they can be confusing since many have different defaults and are in different units.  Below are some of the timeout settings available with a little more detail to help clear up the confusion.
     1. Registry on CRM application server(s)
       1. In seconds
       2. The OLEDBTimeout value controls the SQL time-out value that is used for a single SQL query
       3. Default is 30 seconds
      2. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\ExtendedTimeout
       1. In milliseconds
       2. The ExtendedTimeout value controls the ASP.NET time-out value
       3. Default is 1,000,000
      3. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\NormalTimeout
       1. In milliseconds
       2. Specifies the SOAP call timeout for most operations
       3. Default is 300,000
     2. Web.config
      1. <httpRuntime executionTimeout="300" />
       1. .NET 3.0: “timespan” attribute.  The default is “00:01:50” (110 seconds)
       2. .NET 3.5 and 4.0: an integer in seconds.  Default is 110 seconds.
       3. Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.
     3. IIS/ASP.NET configuration
      1. IIS 6.0 -> Website Properties -> ASP.NET tab -> Edit Configuration button -> Application tab -> Request execution timeout (seconds)
       1. Related to this type of situation in CRM 4.0:http://blogs.msdn.com/b/crm/archive/2008/11/20/asp-net-2-0-50727-0-warning-event-id-1309-due-to-request-time-out.aspx
     4. When using the CRM SDK, there are also timeout settings that can be set via custom code:
      1. CRM 4.0 example:
       1. CrmService service = new CrmService();
       2. service.Timeout = 300;
       3. In milliseconds and default is 100,000
      2. CRM 2011:
       1. ServiceProxy.Timeout property (Timespan)
    Wednesday, November 19, 2014 2:46 AM