tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jäkel, Guido <G.Jae...@dnb.de>
Subject RE: CLOSE_WAIT between Application (Tomcat) and Apache HTTPD
Date Thu, 11 May 2017 06:32:25 GMT
Dear Adhavan,

I think this is quiet normal, because the browser clients "in front" will reuse connections
(using keep-alive at TCP level) but an in-between load balancer may be not work or configured
in this way and will use a new connection for each request to the backend.

Then, you'll see a lot of sockets in the TCP/IP closedown workflow between the load balancer
and the backend server. Pleases refer to TCP/IP that the port even for a "well closed connection"
will be hold some time to handle late (duplicate) packets. Think about a duplicated, delayed
RST packet - this should not close the next connection to this port.

Because this situation is very unlikely or even impossible on a local area network, you may
adjust the TCP stack setting of your server to use much lower protection times (in the magnitude
of seconds) and also adjust others. And at Linux, you may also expand the range of ports used
for connections.

BTW: If you have a dedicated stateful packet inspecting firewall between your LB and the server,
you also have to take a look on this.


Said that, one more cent about the protocol between the LB and the Tomcat: I don’t know
about HTTP, but if you use AJP (with mod_jk) you may configure it to keep and reuse connections
to the Tomcat backend(s).

Guido

>-----Original Message-----
>From: Adhavan Mathiyalagan [mailto:adhav.vit@gmail.com]
>Sent: Wednesday, May 10, 2017 6:32 PM
>To: Tomcat Users List
>Subject: CLOSE_WAIT between Application (Tomcat) and Apache HTTPD
>
>Team,
>
>Tomcat version : 8.0.18
>
>Apache HTTPD version : 2.2
>
>
>There are lot of CLOSE_WAIT connections being created at the
>Application(tomcat)  ,when the traffic is routed through the Apache HTTPD
>load balancer to the Application running over tomcat container. This leads
>to slowness of the port where the Application is running and eventually the
>application is not accessible through that particular PORT.
>
>In case of the traffic directly reaching the Application PORT without HTTPD
>(Load balancer) there is no CLOSE_WAIT connections created and  application
>can handle the load seamlessly.
>
>Thanks in advance for the support.
>
>Regards,
>Adhavan.M
Mime
View raw message