[Madlug] apache maxrequestsperchild and memory leaks
Timm Murray
tmurray-mlug at wumpus-cave.net
Thu Sep 13 13:06:54 CDT 2007
On Thursday 13 September 2007 12:33, John Heim wrote:
> I am responsible for an apache 1.3 server with a 3rd party software
> package running on it. This package leaks memory. I've been looking at the
> httpd.conf file and it says this:
>
> # MaxRequestsPerChild: the number of requests each child process is
> # allowed to process before the child dies. The child will exit so
> # as to avoid problems after prolonged use when Apache (and maybe the
> # libraries it uses) leak memory or other resources. On most systems, this
> # isn't really needed, but a few (such as Solaris) do have notable leaks
> # in the libraries. For these platforms, set to something like 10000
> # or so; a setting of 0 means unlimited.
>
> The default is 100. So you *increase* the number of requests per child to
> help with memory leaks? That seems backward. Is it just a mistake in the
> comments? I googled for it and found some remarks by folks who said they
> changed maxRequestsPerChild to 1000 to fix memory leaks.
I think it's saying that for platforms like Solaris that have specific known
issues, 10000 is the typical number. Every time it hits this limit, the
server has to kill the child and fork a new process. Linux has a cheep
process model, but it's still not something you want to happen often. You'll
need to do some trial-and-error to find a good value for your system, but I'd
guess 1000 is a good starting point.
More information about the Madlug
mailing list