开发者

Tomcat NIO/RESTEasy disconnects TCP after each request

开发者 https://www.devze.com 2023-03-18 19:25 出处:网络
I\'m using RESTEasy asynchronous (Comet) IO support on Tomcat 6 via the NIO Connector. Currently, TCP connections are getting dropped by the server after each response is sent back to the client.

I'm using RESTEasy asynchronous (Comet) IO support on Tomcat 6 via the NIO Connector. Currently, TCP connections are getting dropped by the server after each response is sent back to the client.

All documentation I've read on HTTP Connector configuration for Tom开发者_开发技巧cat suggests that it should keep connections alive by default, so I'm puzzled as to what the problem is.

Here's my connector config:

<Connector connectionTimeout="20000" port="6080" 
           emptySessionPath="true" enableLookups="false" 
           protocol="org.apache.coyote.http11.Http11NioProtocol" 
           acceptorThreadCount="4" pollerThreadCount="12"/>

Thanks for any suggestions!


It turns out the root of the problem is elsewhere (still investigating and will post a separate question directly on that to avoid confusion!).

Tomcat is releasing the connections after a period of a few seconds rather than immediately on responding to the HTTP request. The client in this case is at fault for creating new TCP connections for each request rather than re-using connections already established.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号