PDA

View Full Version : cPanel/WHM: Apache MPM Prefork or Worker? differences



Fli
04-29-2015, 04:45 PM
On WHM/cPanel server,

Apache Mod_QoS module requires Apache Worker to be used instead of default Apache Prefork. Apache Prefork MPM (Multi-Processing Module) is set as "recommended" by WHM/cpanel. They say it is because of the stability.

So is it safe to switch to Worker MPM? What are differences?


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.
Source: http://codebucket.co.in/apache-prefork-or-worker/

So prefork is using one process per one connection, Worker is using one process with multiple "threads" to serve more connections per process.

Worker is said to use less RAM, Prefork to be more "stable" or process "isolated".

Details on both MPM:
Prefork: https://httpd.apache.org/docs/2.2/mod/prefork.html
Worker: https://httpd.apache.org/docs/2.2/mod/worker.html

More description on MPMs, comparison: http://serverfault.com/a/383634

gexacor
07-10-2016, 08:30 AM
So prefork using one process per one connection, Worker is using one process with multiple "threads" to serve more connections per process.
Worker is said to use less RAM, Prefork to be more "stable" or process "isolated".


I'm using prefork on all my servers for a long time and happy with that.
It's only can be a problem if max processes count not configured properly and you servers have more clients that it can serve.
That situation should be treated correctly on httpd.conf file, that's not a big deal.