Ec2 Ubuntu server running apache and php. Mobile application is hosted on server. App connects to server on 80 port. Issue is apache limits to 150 process on peak hours. Cpu is almost 100% idle when apache has 150 process. Increased max clients to 500 on Prefork mpm. But it's still limiting to 150 process. Ps aux and newrelic shows apache process limiting at 150 process.
Issue was MaxRequestWorkers was 150 on /etc/apache2/mods-enabled/mpm_prefork.conf its not changing after increasing value on apache conf. Now changed to
<IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 ServerLimit 1200 MaxRequestWorkers 1200 MaxConnectionsPerChild 1000 </IfModule>
-on /etc/apache2/mods-enabled/mpm_prefork.conf and now apache getting more hits.
ServerLimit variable. It's often not yet in the default config file, so you'll have to add it. Restart Apache to have it take effect (reload doesn't work).
I usually make a block like this:
<IfModule mpm_prefork_module> StartServers 150 MinSpareServers 150 MaxSpareServers 150 MaxClients 150 Serverlimit 150 MaxRequestsPerChild 10000 </IfModule>
This disables worker creation/destruction, to which I see no point.
Read the Apache documentation for the MPM module. It appears you need to increase the MaxRequestServers value.
The page also has a link to performance tuning documentation.