You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Martin Spinassi <ma...@gmail.com> on 2009/09/28 17:51:32 UTC

[users@httpd] Too many CLOSE_WAIT connections

Hi list,


I'm trying a load balance two tomcats servers with one apache in front
wit MPM worker, but after a while, apache left too many connections in
CLOSE_WAIT state until it stops responding.

The problem seems to be that, in a process with 5 threads, it gets some
of them on CLOSE_WAIT, and won't recycle the process until all the
connections get into CLOSE_WAIT, so it start another process, and all
starts again.


I've changed the tomcat and AJP worker to timeout in 10 minutes.
Also changed the amount of threads per child, in order to get low
threads each one, and get more possibilities of get all them in
CLOSE_WAIT, but it just delays a little more the problem.

Connections get in CLOSE_WAIT also when clients closes the site, so I
think that is something with mpm worker.

I've read the documentation of mpm more than 10 times, but can't find
the way to make apache recycle process, even changing the
maxewquestperchild option.


I'm using httpd-2.2.9, tomcat connectors 1.2.26, tomcat 6.0.20 and java
1.6.0_10 on a CentOS 5.3 with 64 bits.

Here is my actual httpd mpm conf:

<IfModule mpm_worker_module>
    StartServers          30
    MaxClients          1500
    MinSpareThreads        5
    MaxSpareThreads        5
    ThreadsPerChild        5
    MaxRequestsPerChild   50
</IfModule>


Any light on this problem is really appreciated. After googling for
about 5 days, I'm completely lost.


Thanks!

Martin



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Too many CLOSE_WAIT connections

Posted by Martin Spinassi <ma...@gmail.com>.
On Mon, 2009-09-28 at 19:48 +0100, Nick Kew wrote:
> Martin Spinassi wrote:
> > Hi list,
> > 
> > 
> > I'm trying a load balance two tomcats servers with one apache in front
> > wit MPM worker, but after a while, apache left too many connections in
> > CLOSE_WAIT state until it stops responding.
> 
> Shouldn't do that.  Have you got some ridiculously long Timeout?
> 
> > The problem seems to be that, in a process with 5 threads, it gets some
> 
> 5 threads is very, very low.
> 
> > <IfModule mpm_worker_module>
> 
> Event MPM should help with this over Worker if there really is
> a problem.  But I'd look at your timeout and threads first.
> And that MaxRequestsPerChild is ridiculously low too: you
> should almost certainly use 0 (unlimited) if it's just
> fronting something on tomcat.
> 

Thank for your response Nick.


Timeout are in normal range, and connector/tomcat have a timeout of 10
minutes (the recommended at tomcat's docs).

I know that the configs are in a ver low performance, but wanted to make
my point int trying to recycle those connections/process.
In the right moment I get fixed this situation, I'll correct them to a
normal operation.


Cheers


Martin


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Too many CLOSE_WAIT connections

Posted by Martin Spinassi <ma...@gmail.com>.
On Mon, 2009-09-28 at 19:48 +0100, Nick Kew wrote:
> Martin Spinassi wrote:
> > Hi list,
> > 
> > 
> > I'm trying a load balance two tomcats servers with one apache in front
> > wit MPM worker, but after a while, apache left too many connections in
> > CLOSE_WAIT state until it stops responding.
> 
> Shouldn't do that.  Have you got some ridiculously long Timeout?
> 
> > The problem seems to be that, in a process with 5 threads, it gets some
> 
> 5 threads is very, very low.
> 
> > <IfModule mpm_worker_module>
> 
> Event MPM should help with this over Worker if there really is
> a problem.  But I'd look at your timeout and threads first.
> And that MaxRequestsPerChild is ridiculously low too: you
> should almost certainly use 0 (unlimited) if it's just
> fronting something on tomcat.


Just in case someone gets the same problem, it's related to a bug
already fixed in apache mpm. Updating the httpd to 2.2.10 or later fixes
it.


Thanks @all.


Martin


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Too many CLOSE_WAIT connections

Posted by Nick Kew <ni...@webthing.com>.
Martin Spinassi wrote:
> Hi list,
> 
> 
> I'm trying a load balance two tomcats servers with one apache in front
> wit MPM worker, but after a while, apache left too many connections in
> CLOSE_WAIT state until it stops responding.

Shouldn't do that.  Have you got some ridiculously long Timeout?

> The problem seems to be that, in a process with 5 threads, it gets some

5 threads is very, very low.

> <IfModule mpm_worker_module>

Event MPM should help with this over Worker if there really is
a problem.  But I'd look at your timeout and threads first.
And that MaxRequestsPerChild is ridiculously low too: you
should almost certainly use 0 (unlimited) if it's just
fronting something on tomcat.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org