Multi-Processing Modules (MPM)
The default processing model (MPM) is the process-based ‘prefork’ model. A thread-based model, ‘worker’, is also available, but does not work with some modules (such as PHP). The service must be stopped before changing this variable.
Enable the worker module
To enable the worker module in apache, edit the apache configuration file /etc/sysconfig/httpd and change the below line
#HTTPD=/usr/sbin/httpd.worker
to
HTTPD=/usr/sbin/httpd.worker
Restart the apache service
[root@dbappweb ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] [root@dbappweb ~]#
Now worker module has been enabled for you apache 2.2.3.
You can change the default values for the worker MPM in the configuration file /etc/httpd/conf/httpd.conf between <IfModule worker.c>…</IfModule> tag. Value for my apache worker.c is shown below:
ServerLimit 40
StartServers 2
MaxClients 1000
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
Parameters details:
StartServers: initial number of server processes to start
MaxClients: maximum number of simultaneous client connections
MinSpareThreads: minimum number of worker threads which are kept spare
MaxSpareThreads: maximum number of worker threads which are kept spare
ThreadsPerChild: constant number of worker threads in each server process
MaxRequestsPerChild: maximum number of requests a server process serves
The above configuration can handle the 1000 concurrent connections. If you want to handle more concurrent connections then change the above parameters as per your requirements.
