How to switch apache mpm prefork to mpm event?

Hello as title says how i can switch mpm prefork to event? i tried follow some guides without success.

I’m trying change this because i’m using mpm event on my old server and i read performs it better than others (worker-prefork) with multiple concurrent connections and consume less resources.

We do not have any docs about switching to mpm event, maybe community can help?

@donko Can you write what all you tried ? What were the errors you faced ?
Switching to mpm_event is fairly straightforward, you do a2dismod phpxx and then do

a2dismod mpm_prefork 
a2enmod mpm_event

but please be warned, you cannot use mod_php based templates after this. HestiaCP does not support MPM_event out of the box

As I said before, better if you try this on a test server and just post if any problems so we can help

I was doing in the wrong way.

Which you wrote worked perfectly.

1- a2dismod php7.3
2- a2dismod mpm_prefork
3- a2enmod mpm_event
and restart apache.

HestiaCP works normally and i can add and disable php versions except php7.3 from config tab.

A short question, I also want to change to MPM event. So any other valuable suggestion regarding this in addition to above. Does above works only when Apache is installed or I can use it when I have nginx + apache both installed.

with both i guess, i’m using nginx + apache.

1 Like

Yes I still don’t get it since 3 years ago. Why mpm prefork is still used in vestacp until this day. Even that 3years old thread in vestacp forum is not replied yet

Even in apache official docs they do not recommend it anymore.

https://cwiki.apache.org/confluence/display/HTTPD/PHP

Please remove support for mpm prefork in hestiacp. As its really old school.

1 Like

Thanks donko for update. I agree with maman. Any special advantages of mpm prefork over mpm event. If it is so easy to change why not make it default so that everyone has good resource usages.