http响应完成后,Tomcat / IIS关闭套接字 [英] Tomcat/IIS closes socket after http response has completed

查看:236
本文介绍了http响应完成后,Tomcat / IIS关闭套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JBoss 4.0.4 GA,它有Tomcat Servlet Container 5.5。
我还将IIS 6.0重定向到这个JBoss。 (通过IIS tomcat连接器,在IIS中用作ISAPI筛选器)。
所有工作正常,按照描述配置了工作程序。

I am using JBoss 4.0.4 GA, which has Tomcat Servlet Container 5.5. I also have IIS 6.0 redirected to this JBoss. (via IIS tomcat connector, which is used as ISAPI filter in IIS). All is working OK, configured the workers as described.

这是连接器的一段workers.properties文件:

Here is a piece of workers.properties file of the connector:

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.jboss0_ajp13.port=8009
worker.jboss0_ajp13.type=ajp13
worker.jboss0_ajp13.host=localhost
worker.jboss0_ajp13.socket_keepalive=1
worker.jboss0_ajp13.socket_timeout=300

但是当通过IIS(端口80)连接到应用程序时),对于HTTP请求的每个完成的HTTP响应,套接字被关闭(FIN在TCP层上发送)。
这导致严重的减速,因为应用程序正在通过WAN工作。 (对于每个关闭的套接字,需要建立另一个套接字,需要500毫秒)。

But when connecting to the application via IIS (port 80), for each completed HTTP response for HTTP request, the socket is closed (FIN is sent on the TCP layer). This causes severe slowdowns, since the application is working over WAN. (for each closed socket, another one needed to be established, which takes 500ms).

直接连接到JBoss Web服务器时不会发生这种情况,并且在发生时也不会发生这种情况。连接到IIS的同一WebServer实例上的不同虚拟目录(即IIS中的Keep-Alive也已配置)。

This is not happening when connecting to JBoss web server directly, and also not happening when connecting to a different virtual directory on the same WebServer instanse of IIS (i.e. Keep-Alive in IIS is also configured).

最新版本的tomcat IIS连接器会发生这种情况。

This happens with the latest version of tomcat IIS connector.

您知道连接器中是否有错误,或者配置是否有问题?

Do you know if there is a bug in the connector, or there is a problem with my configuration?

提前致谢,

Henry。

Thanks in advance,
Henry.

推荐答案

我在Bugzilla中为tomcat IIS重定向器提交了一个错误,这就是我得到的答案:

I filed a bug in Bugzilla for tomcat IIS redirector, and this is the answer I've got:


直到1.2.27这是IIS连接器的行为( IIS强制所有
ISAPI扩展实现自己的HTTP保持活动,IIS连接器
没有这样做。)

在1.2.27中有实验al,构建时,支持HTTP 1.1 chunked
编码,它应允许持久连接。
(我在生产系统中使用了几乎相同的代码大约4
年,但它应该被认为是JK代码库中的实验,直到它的
稳定了一段时间)。

从其中一个下载镜像中获取-chunked二进制文件,并在1.2.27中阅读有关如何
配置chunked编码的内容发行说明(您必须获得
正确版本,并在您的配置中启用它)。
您可以验证连接器是否正在使用带有调试日志记录
的分块编码,并且TCP / Wireshark跟踪应该显示正在重用的连接。

如果你仍然关闭连接,并且日志显示
连接器正在尝试(或应该尝试)分块编码,那么它的
可能最好讨论用户列表,然后在确定存在问题后再使用另一个
Wireshark跟踪+连接器调试日志重新打开。

所以,我做了什么:


  1. 将isapi_redirect.dll与分块支持放在一起。

  2. 使用以下内容配置isapi_redirect.properties:

  1. Put isapi_redirect.dll with chunking support.
  2. Configured the isapi_redirect.properties with the following:

enable_chunked_encoding = 1

重新启动IIS。

这篇关于http响应完成后,Tomcat / IIS关闭套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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