PDA

View Full Version : Several TIME_WAIT with apache2


xomoxo
26th January 2007, 12:08
Hi to all,

This is my first post, and I want to say that this webpage have been so useful to me.

I have a problem with Apache2 and several TIME_WAIT connections. The hardware is a Dual Xeon 3,6 Ghz, and 3,5 Gb of RAM. The systems have:

Apache 2.2.4
PHP 4.4.4
Mysql 4.1.22
Eaccelerator 0.5

When I start apache, it start to create lots of TIME_WAITs connections, in a few minutes I can reach 800 or 900, and only 20 or 25 ESTABLISHED connections.

ServerLimit 240
MaxClients 240
Timeout 120
KeepAlive On
MaxKeepAliveRequests 100
StartServers 50
MinSpareServers 30
MaxSpareServers 45
MaxRequestsPerChild 100
KeepAliveTimeout 5

The SO is Debian 3.1 and the kernel is 2.6.8-3-686-smp.

Thanks to all.

falko
27th January 2007, 15:03
Are there any errors in Apache's error log?

Did you have a look at this tutorial? http://www.howtoforge.com/configuring_apache_for_maximum_performance

xomoxo
29th January 2007, 11:52
Yes, I saw this manual and I think that all the parameters are fine, in the error log there isn't any error. I think that maybe it's a Debian 3.1 problem, because on other server I install the same operative system with the same services, and I have the same problem. In this new system, I get a new kernel from the Backports, and the problem is there too.

falko
30th January 2007, 12:27
StartServers 50
MinSpareServers 30
MaxSpareServers 45

These values are a bit high, I'd say.
Have you tried something like

StartServers 5
MinSpareServers 5
MaxSpareServers 15?

xomoxo
30th January 2007, 14:47
Actually I have:


StartServers 40
MinSpareServers 10
MaxSpareServers 30


Because If it download the values start to appear messages in error_log like:

[info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 8 idle, and 31 total children

(I get it sometimes with this configuration too).

Thanks for all.

falko
31st January 2007, 21:18
How many page views or visits do you have each day? Your server seems to be very busy...

xomoxo
2nd February 2007, 13:52
We have more servers, and all is balanced between all of them, but we don't know why only two servers with Debian 3.1, have all this TIME_WAIT connections.

falko
3rd February 2007, 15:20
You can try this:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100000
KeepAliveTimeout 4
MaxRequestsPerChild 100000