IIS / ASP.NET 如何处理死连接? (HTTP Keep-Alive 无效)
IIS / ASP.NET 可以使用 TCP keepalive 选项来检测死连接吗?请注意,这些连接没有有效的 HTTP Keep-Alive 选项。这些连接刚刚被客户端放弃,使 IIS / ASP.NET 线程挂起,等待数据。 IIS / ASP.NET 是否有适当的机制来处理此类情况?
Can IIS / ASP.NET make use of the TCP keepalive option to detect dead connections? Note that these connections do not have the HTTP Keep-Alive option in effect. These are connections, just abandoned by the clients, leaving IIS / ASP.NET threads hanging, waiting for data. Are there mechanisms in place by which IIS / ASP.NET handles such scenarios?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IIS 可以选择在启用 TCP KeepAlives 的情况下打开连接,但所有研究都表明它使用系统设置。系统默认启用 2 小时 KeepAliveTimes。
http://support.microsoft.com/kb/120642 提供了注册表值的参考。
IIS has the option to open the connection as with TCP KeepAlives enabled, but all research suggests it uses the system setting for it. The system defaults to enabled with 2hr KeepAliveTimes.
http://support.microsoft.com/kb/120642 has references for registry values.
ASP.NET 只处理通过连接发送的 HTTP 数据,没有 HTTP 发生的时期,但 TCP 连接保持活动状态对它来说没有任何意义。
IIS 不会无限期地保持 TCP 连接处于活动状态,但会定期检查它们是否空闲。
ASP.NET only handles HTTP data sent over the connection, the period where there is no HTTP happening, but the TCP connection is kept alive means nothing to it.
IIS will not keep the TCP connection alive indefinitely, but periodically checks them for idleness.