Change Apache: Mod_Prefork to Mod_Worker

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
Hey what's up, I notice cPanel is used by default in the Prefork.

I change it to mpm_worker. ( throw the interface in EasyApache4 inside WHM )

I notice in the APACHE CONFIGURATION:
WHM>Service Configuration »Apache Configuration »Global Configuration
The configuration has not changed to the Default of the original APACHE MPM_WORKER.


The configuration has in the Global Configuration, its the default of mpm_prefork:
https://ibb.co/1qxZ5hM

Now i need to know if prefork is actually in use ( i don't think so, but if this is the situation, what is the cPanel default for mpm_worker? )

i read this in APACHE official doc:
https://httpd.apache.org/docs/2.4/mod/worker.html

but you don't have any configuration you have here inside the httpd. ( as i showed you in the screenshot )

it's like cPanel only designed for mod_prefork.

solutions? default from cPanel to mpm_worker?

what is recommended from cPanel? i search in the doc's the only thing i found is this:
https://support.cpanel.net/hc/en-us/articles/4406506158231-How-to-change-your-Apache-MPM
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,041
111
118
Houston, TX
cPanel Access Level
Root Administrator
Hello! Even if you see those "prefork" directives in the Apache configuration, they aren't necessarily being used. All that means is that if Prefork was in use, it would use those settings. Since it's not, it will use the configurations settings you see a bit lower in the file instead. You should be able to confirm the MPM in use by running the following command via a root SSH session.

Code:
httpd -V | grep -i 'mpm'
 

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
Ok, but you still didn't answer my question my friend :)

The question is:
If have some default configuration when you change mpm_prefork to mpm_worker?

The default cPanel ship to the client is for prefork.
Even when you changed to mpm_worker in EasyApache4.

WHM>Service Configuration » Apache Configuration » Global Configuration

The configuration stays the same, as before. ( the default of mpm_prefork )
This PREFORK default, it's not the default of mpm_worker.
I even didnt know that,
and i sure have a lot of more people using mpm_worker, and thinking this cPanel "DEFAULT"
they maybe think it's fit mpm_worker (absolutely not fit).

For example:


Start Server, Server Limit: (default)
mpm_prefork
Start Servers = 5
Server Limit = 256

mpm_worker
start servers = 3
Server Limit =16


This it's not changed.
You dont have option for max_theard... ( option divided the server limit by 25 )

What we have in cPanel, its the default of mpm_prefork.
cPanel even limited the interface, mod_worker. ( Minimum / Maximum Spare Servers not belong to worker and need be replaced by "Max Theard" )


Now,

I the only thing i want to know:
If have some cPanel script or some "DEFAULT" cPanel offers to the mpm_worker users?? ( like me )


When i said default, its for mpm_worker.

if have some script in the system, made by cPanel can to do the job for me, by the book, i preffer.
right now this is not configuration actually fit mpm_worker.

I sure have something for people using mpm_worker.
please help, even support docomantion will be acceptable.
 
Last edited:

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,041
111
118
Houston, TX
cPanel Access Level
Root Administrator
hello again! I believe I understand. Unfortunately, there is no cPanel-supported way to get this functionality with mod_worker. However, we do have an open feature request where you can offer support for this functionality.

 

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
first, thanks for your response.
second the link before 4 years.

Now, i think i got it.
Actually, i am getting much better results with the server.

The cPanel developer developing the software is very smart... they design cPanel with a kind of Overall DEFAULT.

They even make you kind of DOCOMONTAION:


I checked that all these 2 days.
if you look at the multi-processing link, you will see cPanel provides default and recommendation from the APACHE site.
this recommendation fits cPanel perfectly.

The only thing you need change 2 values (THIS LINK PROVIDE BY CPANEL!):


I checked the values and the cPanel docs:

and i checked the httpd.conf as well:
https://ibb.co/1qxZ5hM

cPanel Design the httpd.conf already.
The only values that need to be changed its:
ServerLimit 16 ( Default )
StartServers 2 ( Default for mpm_worker its 3 - this is optimized value APACHE site recommended and this link provided in the cPanel docomention! )

_________________

If you will change these 2 Values, it will be the same config inside your httpd.conf...
as you see in the screenshot i sent, the cPanel developer design it for it...
cPanel smart bro :)

They are even AWARE to that and they note here:

They already put a note, of several values, have values that work only with PREFORK.
The only problem you never and ever note this problem.
Why not a small note in the interface?
I am sure have a lot of clients use wrong configurations.
( prefork with server limit of 256 - it's insane, mpm_worker overload the server )



Now, I have already tested it on 2 cPanel i have, the result is much better.
but.
It takes me time to understand it.
Nobody from your clients knows this default belongs to MPM_PREFORK.
I am sure all the clients think the EasyApache4 interface does for them the job...!

I recommended cPanel will put a little note next to the value inside the interface:
WHM> APACHE CONFIGURATION > GLOBAL CONFIGURATION.

A little note, to change these 2 values...
it's very important.

It's 20% RAM and 1 CPU spare...
different between the cPanel shipped MPM
compare to MPM_WORKER it's critical.

cPanel should put a small note to change these Values.
clients do not need to guess the DEFAULT belongs to PREFORK.


I hope it's will change something and cPanel will put a note changing these 2 Values.
 
  • Love
Reactions: Spirogg

Spirogg

Well-Known Member
Feb 21, 2018
700
162
43
chicago
cPanel Access Level
Root Administrator
first, thanks for your response.
second the link before 4 years.

Now, i think i got it.
Actually, i am getting much better results with the server.

The cPanel developer developing the software is very smart... they design cPanel with a kind of Overall DEFAULT.

They even make you kind of DOCOMONTAION:


I checked that all these 2 days.
if you look at the multi-processing link, you will see cPanel provides default and recommendation from the APACHE site.
this recommendation fits cPanel perfectly.

The only thing you need change 2 values (THIS LINK PROVIDE BY CPANEL!):


I checked the values and the cPanel docs:

and i checked the httpd.conf as well:
https://ibb.co/1qxZ5hM

cPanel Design the httpd.conf already.
The only values that need to be changed its:
ServerLimit 16 ( Default )
StartServers 2 ( Default for mpm_worker its 3 - this is optimized value APACHE site recommended and this link provided in the cPanel docomention! )

_________________

If you will change these 2 Values, it will be the same config inside your httpd.conf...
as you see in the screenshot i sent, the cPanel developer design it for it...
cPanel smart bro :)

They are even AWARE to that and they note here:

They already put a note, of several values, have values that work only with PREFORK.
The only problem you never and ever note this problem.
Why not a small note in the interface?
I am sure have a lot of clients use wrong configurations.
( prefork with server limit of 256 - it's insane, mpm_worker overload the server )



Now, I have already tested it on 2 cPanel i have, the result is much better.
but.
It takes me time to understand it.
Nobody from your clients knows this default belongs to MPM_PREFORK.
I am sure all the clients think the EasyApache4 interface does for them the job...!

I recommended cPanel will put a little note next to the value inside the interface:
WHM> APACHE CONFIGURATION > GLOBAL CONFIGURATION.

A little note, to change these 2 values...
it's very important.

It's 20% RAM and 1 CPU spare...
different between the cPanel shipped MPM
compare to MPM_WORKER it's critical.

cPanel should put a small note to change these Values.
clients do not need to guess the DEFAULT belongs to PREFORK.


I hope it's will change something and cPanel will put a note changing these 2 Values.
Thank you @nadav123
great explanation..
Appreciate the hard work you put into getting the correct information :)
trying it out now

Spiro
 
  • Like
Reactions: nadav123

nadav123

Well-Known Member
Mar 2, 2020
159
18
18
Orlando, FL
cPanel Access Level
Root Administrator
You will not disappointed, i use this, it's amazing, all the server CPU and RAM go down significantly, my site actually functions much better from the day i did this.
I think cPanel is very advance, cPanel is a 20 years panel for Linux, can be compared to Windows of Microsoft.

The guys really work on this thing, ( the real developers, not the support agents ), are really genius...
You only need to follow the cPanel docs, most of the answers its already there:
cP Support

Even what i sent here, everything is from cPanel docs, the problem, sometimes hard to understand, and the support guys not actually developed the softewere.
But in the doc's you understand to have something bigger than the support and have developers already think about these options. ( like mpm_worker ).

the guys who invent cPanel know what they doing better than us, and they give you everything on a silver plate, the only thing is to understand.
like you buy Microsoft but at the start is not go so well, take a couple of years, to really get Windows / Microsoft for real, the same thing cPanel

___________________

Another last thing, i recommended to you:
Install Engintron with this configuration of Apache.
This is like Nginx from cPanel but does not belong to cPanel, its actual plugin with the interface can help Apache mpm_worker A LOT!

With Engintron you will NOT get TTFB no matter what the distance of the server from your clients ( even U.S AND CHINA ).

What its beautiful here is Engintron Designed for cPanel Default and MPM_WORKER...
its mean you not need touch nothing after that and any update of cPanel (and Engintron) will fit you without isiues.

Hope its will help you.
 
  • Like
Reactions: cPRex