multiple httpd processes (not fixed number of processes) running on my box. How to limit that number of processes on linux?

Bvm 18
Bvm 18 used Ask the Experts™
Hi All,

I have httpd with worker MPM. I do want to limit that to 1 process with root and only 3 child processes under my account (guest).

Sometimes, I could see 5 or 6 or 7 httpd child processes running on my box.

how to limit the child processes for httpd ?

How to configure/fix this ?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Principal Software Engineer
The worker MPM automatically adjusts its number of children depending on the load.  If you're seeing more than three or so processes, it's because the server needed them to deal with an increased load.

The number of server processes can be limited but it is not a good idea to do so if the server is spawning children.  The result would be that service slows down when there are not enough child processes to deal with the number of incoming requests.

A more effective way to limit the number of child processes is to limit the number of requests per child.  The server then can still spawn as many child processes as are necessary, and the children will terminate in a reasonable time because they will hit the request limit.

Under Apache 2.4, MaxRequestsPerChild was renamed to MaxConnectionsPerChild.

# MaxRequestsPerChild: Maximum requests to process per child/server
MaxRequestsPerChild 32

Open in new window

Side note:  The default is 0, "no limit" and so the children stay in.  I think 32 is probably too low for a high-load server, 1024 too high for a low-load server.  It is one of those parameters that should be tuned for the usage pattern of the individual installation.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial