Multi-processing modules in apache

The Apache HTTP Server is designed to be a powerful and flexible web server that can work on a very wide variety of platforms in a range of different environments. Apache2 comes with 2 multi processing modules(MPMs) which are responsible for binding to network ports on the machine, accepting requests, and dispatching children to handle the requests.:
1. Prefork
2. Worker
What is the difference between this two?
Prefork MPM uses multiple child processes with one thread each and each process handles one connection at a time.
Worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time.
On most of the systems, speed of both the MPMs is comparable but prefork uses more memory than worker.
Which one to use?
Websites that need a great deal of scalability can choose to use a threaded MPM like worker (because of low memory usage) while sites requiring stability or compatibility with older software can use a prefork (prefork is more safe if using libraries which are not thread safe).
Running following command to check which MPM on linux :
#httpd -V |grep MPM
or
#apachectl -V |grep MPM

Comments

Popular posts from this blog

Web Servers Load balancing with HAProxy

Redirect all unencrypted traffic to HTTPS in Apache

Using nginx as http load balancer