Advice I've found on the internet recommends calculating your Apache MaxClients based on how much RAM your average Apache process takes up. Just glancing at top, for my site that seems to be around 650KB. I have 32GB of RAM, with MySQL using about 20GB. If I gave Apache just half the remaining, 6GB, then I could supposedly handle ~9231 Apache processes.

But each Apache process spawns a PHP process, doesn't it? And my average PHP process is about 40MB. If I account for that, I get about 147 processes. Vastly different numbers. Can anyone shed any light on this question?


I believe apache processes grow in size based on other variables as well, over time.

You should load test your site and see what happens. Maybe save some ram for the cache/buffering/headroom too. You don't want to start swapping.

Check out this: https://loadimpact.com/

And this: http://junit.org/

I'm sure there are tons of other apps/services available for that.


If this site is accurate, it will help understand apache memory usage and it discusses PHP and how to reduce it's memory usage.


| improve this answer | |
  • Right but the basic question is, should I account for the PHP processes when determining my max Apache clients, or not? – Buttle Butkus Oct 8 '15 at 23:47
  • Sorry I can't say for sure (been out of the game for a while), but I know you will have a hard time being accurate accounting for process memory usage unless you test your site. – Ryan Babchishin Oct 8 '15 at 23:51
  • Ok, thanks for your recommendations, Ryan. Did you retire after your stock options vested? – Buttle Butkus Oct 8 '15 at 23:51
  • I wish I had stock options. I added some more info for you. Good luck. – Ryan Babchishin Oct 9 '15 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.