Re: MaxRequestsPerChild and MaxKeepAliveRequests clarification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Cutting wrote:
Hi all,

I'm running Apache 2.2.9 on a machine with 4G of RAM, and the server experiences about 100,000 hits a day, ~1G bandwidth and about 30,000 page requests.

That's about 100 times more memory than you should need for the load :)

It's running several instances of a large PHP web app so there are comparatively few users who between them request many pages each.

I'm trying to work out the optimal settings for the server - I used to have MaxRequestsPerChild set to 2000 and MaxKeepAliveRequests at 300 - but the server started swapping towards the end of each day.

You have a problem.  That's an extremely low MaxRequestsPerChild.
Sounds like you may have a BIG memory leak!

I read somewhere that when the MaxKeepAliveRequests directive is set, each server will actually serve MaxKeepAliveRequests multiplied by MaxRequestsPerChild before it dies - which in my case was 600,000 requests. Is this indeed correct?

No.  MaxRequestsPerChild should actually read MaxConnectionsPerChild.
But the keepalives is something you'll hit much more rarely, unless
one of your PHP pages generates several thousand hits to images,
stylesheets, etc.  A mere 300 could only generate that many keepalive
requests if a browser confined itself to a single connection - which
AFAIK no mainsteam browser has done since Netscape 0.9 implemented
parallel connections in (IIRC) 1994.

I'm keen to make the best use of the memory but at present have set MRPC down to 300 and memory use has stabilised. Any advice on the optimal balance between the two settings would be very much appreciated,

Find out what's leaking memory.

You might also benefit from swapping to a threaded MPM (e.g. worker)
and run your PHP under fastcgi with mod_fcgid.  That way you could
also raise your MaxClients, which looks very, very low, and
drop all use of MaxRequestsPerChild.

--
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux