Apache prefork mode MaxRequestsPerChild

apache-2.2

From an article:

"With this prefork model, Apache is managing several child processes, and each process could be used to manage one HTTP request. "

Is this true?

Then why is the:

 MaxRequestsPerChild: maximum number of requests a server process serves

In the config. I guess it's default value 0 means unlimited requests per child but then this means that the first statement is not correct and all of these preforked apache processes can serve multiple requests.

Best Answer

The docs about MaxRequestsPerChild (known as MaxConnectionsPerChild as of httpd 2.3.9) is pretty clear

The MaxConnectionsPerChild directive sets the limit on the number of connections that an individual child server process will handle. After MaxConnectionsPerChild connections, the child process will die. If MaxConnectionsPerChild is 0, then the process will never expire.

Setting MaxConnectionsPerChild to a non-zero value limits the amount of memory that process can consume by (accidental) memory leakage.

Related Topic