Prefork vs Event Apache 2.4
Hello!
I want to change the mpm for our WHM servers, from the standard prefork module to event.
Can this be done during operational hours for the servers without any interruptions or problems for our websites?
Reason I want to change is because I think that even though our servers do not have that many websites, they are hogging a lot of memory! So I want to optimize the servers even further with changing the mpm.
Thanks!
EDIT: Also want to add that we do have mod_ruid2 installed, but I am not that certain of what mod_ruid2 actually does. What would happen if you just disable it? Will it have any complications going to event from an environment that has mod_ruid2 enabled?
-
Hi @MichaelW. You may want to read up on the documentation going over the mpms before making the switch Multi-Processing Modules - MPMs - EasyApache 4 - cPanel Documentation Though in most cases there is no downtime you may want to ensure you're prepared. As far as ruid2 we do have some information here: PHP Handlers - EasyApache 4 - cPanel Documentation Information on what mod_ruid2 is can best be found here mind04/mod-ruid2 essentially mod_ruid2 changes the permissions of the HTTP requests for a domain to the permissions of the owner of that domain. If you do not select an Apache module that changes the permissions of Apache requests, your Apache web server will run Apache processes as the nobody user, which presents security risks. The following Apache modules also change the permissions of Apache requests: - mpm_itk_module
- suexec
- mod_suphp
0 -
Hi @MichaelW. You may want to read up on the documentation going over the mpms before making the switch PHP Handlers - EasyApache 4 - cPanel Documentation Information on what mod_ruid2 is can best be found here
0 -
you need to switch to php-cgi or suphp or if running CloudLinux lsapi 0 -
Also, even though mod_ruid2 is installed, there are still some processes being run with a "nobody" user. How can I prevent this if I change to the worker or event mpm?
You won't stop this altogether, this will just prevent users httpd processes from being created as the nobody user. httpd's own processes are still run under the nobody user my server for example: You can see I'm running the prefork MPM with ruid2:[root@server ~]# httpd -M |grep mpm mpm_prefork_module (shared) [root@server ~]# rpm -qa |grep ruid2 ea-apache24-mod_ruid2-0.9.8-15.15.27.cpanel.x86_64
And I have multiple proceses run by the nobody user:[root@server ~]# ps faux |grep nobod[y] nobody 3936 0.0 0.1 419992 7392 ? Sl 07:55 0:00 | \_ Passenger ust-router nobody 3956 0.0 0.5 297272 21584 ? S 07:55 0:00 \_ /usr/sbin/httpd -k start nobody 3957 0.0 0.5 297272 21584 ? S 07:55 0:00 \_ /usr/sbin/httpd -k start nobody 3958 0.0 0.5 297272 21584 ? S 07:55 0:00 \_ /usr/sbin/httpd -k start nobody 3959 0.0 0.5 297136 21216 ? S 07:55 0:00 \_ /usr/sbin/httpd -k start nobody 3960 0.0 0.5 297272 21584 ? S 07:55 0:00 \_ /usr/sbin/httpd -k start0 -
Thanks for both of your replies! That information really helped me understand how the process works, cPanelLauren. So in our environment we have PHP-FHM on, and according to WHM the PHP handlers are not applied to PHP-FPM. Is it recommended to have PHP-FPM on when running event or worker? Because this is probably what I will end up with if it comes with good stability, security and efficiency. Also to add, we are not running CloudLinux lsapi. 0 -
Hi @MichaelW. Usually I'd recommend worker or prefork though event might do the trick for you with php-fpm - the thread here may be helpful the thread here may be helpful as well I don't know if you have already but the apache documentation on even is really informative and worth the read: Thanks! 0 -
Hello again. Thanks again for your very informative replies! I have decided to try out event, and also go with installing mod_http2 to enable that. If it doesn't give the optimization and performance I am looking for, then I will try worker. Thanks for all the help! 0 -
Hi @MichaelW. That's a great plan and please let us know if you have any questions along the way! Thanks! 0
Please sign in to leave a comment.
Comments
8 comments