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.
https://www.digitalocean.com/community/tutorials/how-to-optimize-apache-web-server-performance