在我们的IIS日志中,为什么requestTimeout为110秒时请求持续5分钟或更长时间? [英] In our IIS logs, why do requests last 5 min and longer when executionTimeout is 110 seconds?

查看:1531
本文介绍了在我们的IIS日志中,为什么requestTimeout为110秒时请求持续5分钟或更长时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在服务器性能方面遇到了一些问题,在分析我们的IIS请求日志时,我们看到很多请求需要几个分钟才能完成。



当ASP.NET httpRuntime 设置元素中的 executionTimeout 的默认值为<时,这怎么可能?强> 110秒?从



我还检查了我们的代码库,以便调用 HttpContext.Server.ScriptTimeout 但是在极少数情况下只有两个被执行,最多被分配600(秒)。

解决方案

如果不了解您的应用和环境,很难说。但是,此链接可能有助于解释为什么它可能高于预期。



IIS 6.0和IIS 7.0 HTTP日志记录中的时间字段描述



具体来说:


从IIS 6.0开始,时间字段通常包括网络时间。在HTTP.sys在time-taken字段中记录值之前,HTTP.sys通常等待客户端确认最后一个响应数据包发送操作或HTTP.sys等待客户端重置底层TCP连接。因此,当通过慢速网络连接向客户端发送大响应或大响应时,时间字段的值可能会超出预期值。



注意如果满足下列条件之一,则time-taken字段中的值不包括网络时间:




  • 响应大小小于或等于2 KB,响应大小来自内存。

  • 使用TCP缓冲。使用HTTPAPI.dll的应用程序可以设置HTTP_SEND_RESPONSE_FLAG_BUFFER_DATA标志以在
    Windows Server 2003 Service Pack 1及更高版本上启用TCP缓冲。这允许服务器
    将所有响应数据发送到客户端,而无需等待
    来获取客户端的相应确认。


希望有所帮助。


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:

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).

解决方案

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.

这篇关于在我们的IIS日志中,为什么requestTimeout为110秒时请求持续5分钟或更长时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆