Oliver
Oliver

Reputation: 9518

In our IIS logs, why do requests last 5 min and longer when executionTimeout is 110 seconds?

We're having some trouble with our server performance and while analyzing our IIS request logs we see lots of requests that take several minutes to complete.

How is this possible when the default value for executionTimeout in the ASP.NET httpRuntime settings element is 110 seconds? From the docs say about executionTimeout [emphasis mine]:

Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This is exactly the behavior we would like to see but below log entries make us believe that something is wrong and those requests are not terminated after the configured (or default) timeout:

slowest requests

I've also checked our code base for calls to HttpContext.Server.ScriptTimeout but there are only two of them that are executed in some rare cases and are assigned at most 600 (seconds).

Upvotes: 3

Views: 2698

Answers (1)

WonderGrub
WonderGrub

Reputation: 396

It's difficult to say without knowing more about your app and environment. However, this link may help to explain why it can be higher than expected.

Description of the time-taken field in IIS 6.0 and IIS 7.0 HTTP logging

Specifically:

Beginning in IIS 6.0, the time-taken field typically includes network time. Before HTTP.sys logs the value in the time-taken field, HTTP.sys usually waits for the client to acknowledge the last response packet send operation or HTTP.sys waits for the client to reset the underlying TCP connection. Therefore, when a large response or large responses are sent to a client over a slow network connection, the value of the time-taken field may be more than expected.

Note The value in the time-taken field does not include network time if one of the following conditions is true:

  • The response size is less than or equal to 2 KB, and the response size is from memory.
  • TCP buffering is used. Applications that use HTTPAPI.dll can set the HTTP_SEND_RESPONSE_FLAG_BUFFER_DATA flag to enable TCP buffering on Windows Server 2003 Service Pack 1 and later. This allows the server to send all of the response data to the client without having to wait for the client’s corresponding acknowledgements.

Hope that helps.

Upvotes: 2

Related Questions