Why does MPM prefork faster than any other MPM?

kiti

Member
Sep 16, 2015
18
3
3
france
cPanel Access Level
Root Administrator
Hi,

I have tried to switch to MPM event. Then, i have done some stress test using ab tool. The MPM event did always better than the default MPM prefork.

However, when i visit my websites using a special tool bar to check page load, i can see the MPM prefork is better than any other MPM..

Furthermore, i have used tuning in my apache config with MPM event and also in my my.cnf. Is it normal or did i miss something with MPM event?
 

Pankaj K

Member
Mar 13, 2017
7
0
1
India
cPanel Access Level
Root Administrator
yes I have also found MPM prefork working better for most of the servers pretty well. Recently we faced issue on one server where MPM was set to worker and apache was hanging with the message scoreboard is not full. We have switched it to MPM prefork and server started performing well.
 

ssfred

Well-Known Member
Jan 6, 2012
65
4
58
India
cPanel Access Level
Root Administrator
Twitter
Hello Pankaj,

I think the performance highly depends on your requirements and resource availability. Prefork is an excellent option if you have better RAM. But when it comes to servers with relatively lower RAM, Worker and event appear to out perform prefork.

Glad to know that switching to prefork helped you in getting the desired output :)
 

kiti

Member
Sep 16, 2015
18
3
3
france
cPanel Access Level
Root Administrator
For your information, my issue with MPM prefork was related to wordpress. For some reasons, the Mariadb transactions are slower using Prefork rather than worker with Wordpress. I used other CMS or coded myself PHP to mariadb and saw that prefork was great. .

For sure, in apache, i have tuned my MPM prefork to always have the maximum
 

vacancy

Well-Known Member
Sep 20, 2012
306
89
28
cPanel Access Level
Root Administrator
Prefork is a more stable mpm. But both memory and CPU have their disadvantages. Not efficient in process management. Separate processing for each request is causing high resource consumption.

Mpm event is more efficient in resource usage. But in some cases it is not as stable as prefork.

I'm testing mpm event + php-fpm. I did not have a big problem, everything is fine.