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

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 ?

Bvm 18Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dr. KlahnPrincipal Software EngineerCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.