Reputation: 31
We have a optimized Apache 2.2 setting which works fine, but after upgrading to Apache 2.4 it seems not reflecting. Both Apache were enabled with worker module, have shared the details below.
Apache 2.2 Settings
<IfModule worker.c> ServerLimit 40 StartServers 40 MaxClients 2000 MinSpareThreads 2000 ThreadsPerChild 50 </IfModule>
Apache 2.2 Server-Status output
35 requests currently being processed, 1965 idle workers
Apache 2.4 Settings
<IfModule worker.c> ServerLimit 40 StartServers 40 MaxRequestWorkers 2000 MinSpareThreads 2000 ThreadsPerChild 50 </IfModule>
Apache 2.4 Server-Status output
1 requests currently being processed, 99 idle workers
Need someone's help to point out me the missing setting so that I can have my Apache 2.4 to create 2000 threads at the startup of Apache service.
Thanks.
Upvotes: 1
Views: 1092
Reputation: 31
Thanks Daniel for your response.
I just found the issue few hours back. The conf '00-mpm.conf' (which has the modules to enable prefork / worker / event) was called below the worker.c module setting which seems to have caused the issue. Moving it above the worker setting made apache to pick up the worker setting mentioned.
Upvotes: 2
Reputation: 144
First off, if you need IfModule, you should use as that is the actual name of the module. Secondly, you should not be using IfModule if you know that module is going to be there. Just use the configuration options, don't sugarcoat it with IfModule.
Secondly, I would recommend you switch from the worker mpm to the event mpm, especially if you have a high load on your server, as the event mpm is geared towards solving the c10k problem, whereas worker mpm just "throws more threads at it".
Having said all that, it does not appear that your configuration, as shown, is the cause of this, so the problem is elsewhere. To better get a look at what's going on, you should:
Remove the IfModule stuff around your directives, let the directives be applied unconditionally
Check the first entries of your error log (which will tell you whether httpd is overriding your settings itself) or check the output from when you manually start httpd. If httpd strongly disagrees with your settings, it will let you know why.
Grep, within your configuration file space, for the directives you have above, and see if any other configuration files are overriding them.
I would have posted this as just a comment, but eh...not enough karma :(
Upvotes: 1