IIS 6 关闭连接 - 如何保持其持久性?
我的公司有两台根据客户配置建模的测试服务器,
- 一台配备 Windows Server 2003 SP2、IIS 6 和 Tomcat 5.5,
- 一台配备 Windows Server 2008 R2、IIS 7 和 Tomcat 6。
两台 IIS 均配置为使用 Windows 身份验证并具有 ISAPI 筛选器对于雄猫。
对于 IIS 6 计算机,服务器通过发送标头“Connection: close”来关闭每个经过身份验证的 http 连接。对于 IIS 7 计算机,服务器使用持久连接,并发送标头“Persistent-Auth: true”。使用 IIS 6 的客户具有与我们的测试服务器相同的连接关闭行为,由于 NTLM 身份验证,网络往返次数增加了三倍。
为什么 IIS 6 服务器关闭连接,如何使其使用持久连接?
我对两台服务器都有 RDP 管理员访问权限,并且很乐意提供任何有用的信息并进行实验。
更新:
我发现该问题部分是由 ISAPI 过滤器 (isapi_redirect.dll) 版本过时引起的。将该过滤器更新到 1.2.32 后,我不再获得 html 页面的“Connection: close”标头。但是,当客户端小程序访问返回序列化 Java 对象的服务时,我仍然会得到它。
My company has two test servers modelled after customer configurations,
- one with Windows Server 2003 SP2, IIS 6 and Tomcat 5.5,
- one with Windows Server 2008 R2, IIS 7 and Tomcat 6.
Both IIS are configured to use Windows Authentication and have an ISAPI filter for Tomcat.
With the IIS 6 machine, the server closes every authenticated http connection by sending the header "Connection: close". With the IIS 7 machine, the server uses persistent connections, and sends the header "Persistent-Auth: true". The customer with IIS 6 has the same connection-closing behaviour as our test server, which triples the number of network roundtrips due to NTLM authentication.
Why is the IIS 6 server closing connections, and how can I make it use persistent connections?
I have RDP admin access to both servers, and will happily provide any useful information and make experiments.
UPDATE:
I found that the problem is partially caused by an outdated version of the ISAPI filter (isapi_redirect.dll). After updating that filter to 1.2.32, I no longer get the "Connection: close" header for html pages. However, I still get it when the client applet accesses a service which returns serialized Java objects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现这个问题与身份验证无关。 Tomcat servlet 使用分块传输编码作为其响应,ISAPI过滤器未配置为处理它,这似乎强制 IIS 6 关闭连接。 IIS 7 似乎收集响应块,并将整个响应(未分块)发送给调用者。
升级到版本 1.2.32 并使用 ISAPI 过滤器的
enable_chunked_encoding
属性启用分块编码后,如 参考指南,连接不再关闭。I found that the problem had nothing to do with authentication. The Tomcat servlet uses chunked transfer encoding for its response, and the ISAPI filter was not configured to handled it, which seems to force IIS 6 to close the connection. IIS 7 seems to collect the response chunks, and sends the whole response, un-chunked, to the caller.
After upgrading to version 1.2.32 and enabling chunked encoding using the
enable_chunked_encoding
property of the ISAPI filter, as described in the reference guide, connections are no longer closed.