Apache

How to:- Enable Worker MPM (mpm_worker_module) in Apache/2

Apache Multi-Processing Modules (MPM) used for creating child processes in Apache. Apache Worker MPM is able to server large number of requests with fewer system resources than a process based server. A single control process is responsible to launch child processes and each child process creates a fixed number of server threads as defined in the ThreadsPerChild directive.Each thread handles one connection.

Before enabling Apache MPM let’s first see the advantages and disadvantages of it.

Advantages:

1. It Create Multiple Processes and many threads per process, threads handle requests.
2. Consume less resources than Prefork and handle more request with less memory.
3. It uses less memory and provides higher performance.

Disadvantages:

1. It is not suitable for non-thread safe libraries ( requires a thread-safe processor to handle dynamic content)
2. Entire process will be terminated and affecting all of the threads if single thread is out of control.
3. It does not provide the same level of isolation request to request as a process based MPM does.

If you are using default Apache installation, it will use Prefork MPM by default.

In this article I will help you to disable default Prefork MPM and enable Worker MPM on Apache 2.4.

Enable Worker MPM in Apache

First you will need to edit Apache configuration.

# vim /etc/httpd/conf.modules.d/00-mpm.conf

Comment the LoadModule line for mpm_prefork_module and un-comment LoadModule line for mpm_worker_module in configuration file as per showing below.

# LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

LoadModule mpm_worker_module modules/mod_mpm_worker.so
apache_mpm_worker

After un-commenting mpm_worker_modules just restart your Apache services.

# service httpd restart

OR

# /etc/init.d/httpd restart

That’s it. Now check the active MPM.

Check Active MPM in Apache

After successfully enabling Worker MPM in your Apache server. You can verify current running MPM on your Apache server using below command.

# httpd -V | grep MPM

Server MPM: worker

I hope This Article will help to enable Worker MPM in Apache 2.4 version. If you have any queries and problem please comment in comment section.

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

1 Comment

  • Thanks a lot, I am new to Apache and this article certainly helped in understanding what I need to choose. I would like to know if it’s OK to place link to this article and some snippets of it in our internal documentation page for others reference (Acknowledgement will be added)

Leave a Comment