Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

KeepAlive ON + 22GB memory on Debian 6.0

Problem with lacking memory when KeepAlive is ON

7:23 pm on Apr 27, 2012 (gmt 0)

New User

joined:Apr 27, 2012
posts: 4
votes: 0


I am using Apache as web server that redirect by proxy specific subdomain static.example.com to Lighttpd. Lighttpd works on another port than Apache, but on the same IP and server.

My website server flash games ans images so sometimes it takes a while to load content, but I was using KeepAlive ON with no problem.

Now, I reinstalled OS from Debian 5.0 to Debian 6.0 and when I turn on KeepAlive I have all 24GB server memory consumed by Apache and 1002 process running. I want more and allow more, but there is probably no more memory.

My previous configuration on Debian 5.0:

KeepAlive ON
<IfModule mpm_prefork_module>
StartServers 25
MinSpareServers 10
MaxSpareServers 35
ServerLimit 3520
MaxClients 3520
MaxRequestsPerChild 150

I didn't checked how much memory and processes Apache consumed, because it worked. It works on Debian 5.0 more than one year.

On Debian 6.0 I had to switch to KeepAlive Off and I also decreased ServerLimit and MaxClients to 1000, because there is max 400 processes when KeepAlive is off.

Is something different on Debian 6.0 regarding Apache + Lighttpd?

When I was using Lighttpd through Apche proxy and when a large game is loading then Apache still keep process instead of killing it?

Could I upgrade something to have KeepAlive On?

I tested website with KeepAlive off on Google Page Speed and this tool said me: "Turn On KeepAlive. Your website sucks without it"
I tested this configuration on two servers with identical hardware. There was 1002 apache processes and 22 GB memory consumed. I checked it on munin. It was committed memory.
7:38 pm on Apr 27, 2012 (gmt 0)

New User

joined:Apr 27, 2012
posts: 4
votes: 0

There is also PHP 5.4. Before was PHP 5.3. Could it be "reason for failure"?
7:59 pm on Apr 27, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member billys is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:June 1, 2004
votes: 0

Is there a database server involved? Did you use your old my.conf when you moved to Debian 6.0?
8:24 pm on Apr 27, 2012 (gmt 0)

New User

joined:Apr 27, 2012
posts: 4
votes: 0

I'm using Postgresql on another server. Database servers is in local network so latency is less then 1ms. I'm caching data with Memcached. I have DirectAdmin installed.
7:53 am on Apr 28, 2012 (gmt 0)

New User

joined:Apr 27, 2012
posts: 4
votes: 0

I attached graphs from munin. You can see big change in memory and in apache processes counter when I turn on KeepAlive On instead of KeepAlive off.
Apache processes
[img207.imageshack.us ]

Exceed 12GB server memory
[img214.imageshack.us ]

I upgraded from PHP 5.4.0 to PHP 5.4.1, but there was no change (today hop).
5:27 pm on Apr 29, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 10, 2004
posts: 386
votes: 8

Are you also setting MaxKeepAliveRequests?