Apache Global Configuration for MPM Event
-
I have recently moved to MPM event from Prefork ergo this is a super relevant question for me also! After reading this article (link below) and what Linux4Me2 wrote I am sure that the default apache global settings needs to be changed. Tuning/Optimizing Apache on cPanel Servers - Northon Torga I would like to see the answer for the question of Linux4Me2! I also like to ask about a bug in capanel. Is that still there? The article sasy: "The only trick here is, you have to set ServerLimit to 512 and MaxRequestWorkers to 400 and rebuild. Then, you set ServerLimit to 16 and rebuild. cPanel has a "bug" that force MaxRequestWorkes to be smaller or equal to ServerLimit, if both are changed the same time. When you change only ServerLimit in the second time, MaxRequestWorkes won"t be touched." Best, Z 0 -
Hello, The performance-related options in "WHM >> Apache Configuration >> Global Configuration" are intended for the Prefork MPM. You will notice the following under the "Notes" section for some of the values in the corresponding document: [LIST] - To configure this setting in EasyApache 4, you must install the MPM Prefork module.
Configuring those values via Web Host Manager for the Worker and Event MPMs is not supported at this time. There's a thread on this topic at: Using 'Global Configuration' for MPM Worker Additionally, I recommend opening a feature request to add support for the Worker and Event MPMs when configuring these settings in WHM. Thank you.0 - To configure this setting in EasyApache 4, you must install the MPM Prefork module.
-
According to the thread Using 'Global Configuration' for MPM Worker, it sounds like you need to add the: ServerLimit 16 MaxClients 400 StartServers 3 ThreadsPerChild 25 ThreadLimit 64 to the Pre-main Include as well as modifying the Apache local file and rebuilding, but since these are the default values for MPM Event, maybe that's not necessary? If there were a way to output the current settings being used by Apache as @Zoltan Szabo inquired, we would be able to tell if any modifications are necessary. I added the feature request. 0 -
I read the manual for httpd, and I couldn't find a way to output the values of the current settings for MPM Event. It doesn't make sense to me that one would have to add parameters to both the Pre-main include and /var/cpanel/conf/apache/local. If the Apache Global Configuration UI does eventually include a way to configure MPM Event, it makes sense to me that the way it would work is that it would modify /var/cpanel/conf/apache/local and then restart Apache. I tested this by taking a look at /var/cpanel/conf/apache/local, then changing my Start Servers setting from 5 to 3 in the Global Configuration UI. I looked at /var/cpanel/conf/apache/local again, and the setting there had changed to 3. That leads me to assume--maybe incorrectly--that all I really need to do for MPM Event is to change the settings in Apache's Global Configuration that correspond to the settings I want to use for MPM Event to the correct values (Server Limit, Max Request Workers, and Start Servers), and either not do anything for Threads Per Child and Thread Limit since they aren't currently in the Global Configuration UI, or add them to /var/cpanel/conf/apache/local. If I look at the list of available directives in the Apache Directive Quick Reference, there are a lot of them that don't appear in my /var/cpanel/conf/apache/local. That makes me suspect that the default values are used if there are no local settings. Since I want the defaults for Threads Per Child and Thread Limit, I'm thinking I don't have to add them to /var/cpanel/conf/apache/local. If someone who actually knows how this stuff works doesn't correct me, I'm thinking about giving it a try. 0 -
The Global Configuration UI wouldn't let me change Max Request Workers to the 400 that is recommended for Event MPM, so I went ahead and edited /var/cpanel/conf/apache/local, setting it there, and while I was in there, added entries for Threads Per Child (25) and Thread Limit (64), ran /scripts/rebuildhttpdconf to rebuild the httpd conf, and restarted Apache. So far, nothing has broken. (Fingers crossed.) 0 -
The Global Configuration UI wouldn't let me change Max Request Workers to the 400 that is recommended for Event MPM, so I went ahead and edited /var/cpanel/conf/apache/local, setting it there, and while I was in there, added entries for Threads Per Child (25) and Thread Limit (64), ran /scripts/rebuildhttpdconf to rebuild the httpd conf, and restarted Apache. So far, nothing has broken. (Fingers crossed.)
"The only trick here is, you have to set ServerLimit to 512 and MaxRequestWorkers to 400 and rebuild. Then, you set ServerLimit to 16 and rebuild. cPanel has a "bug" that force MaxRequestWorkes to be smaller or equal to ServerLimit, if both are changed the same time. When you change only ServerLimit in the second time, MaxRequestWorkes won"t be touched." Can anyone from Cpanel please confirm that changing Apache Global config is the right way for MPM event? Also a method to check current settings would be appreciated! Bye Z @linux4me2 So far I have no complaints for my sites so I just wait till it turns out if I need to do anything or just use apache global (unfortunately 2 times because the mentioned bug)0 -
All right everybody, I was also brave and did the changes, and works all right! I have done this in apache global config. With the trick of double saving (server limit first 512 and second down to 16) it works direct from WHM! See the screenshot of my current settings in WHM I beleive the not touched 2 extra settings (ThreadsPerChild, ThreadLimit) keeps to be the default value for MPM event Event though it would be a nice feature to test current settings, somehow ? My sources apart from this forum: This link helps a lot with explanation and they also used cpanel! Tuning/Optimizing Apache on cPanel Servers - Northon Torga If you want to learn more of MPM event and apache optimisation this is an excellent writing. And did really highlighted the path for my apache optimisation! Apache - Apache 2.4 Event optimization guide 0 -
@Zoltan Szabo the double-saving workaround for getting Server Limit is a nice touch. From my reading of the Apache documents on Minimum Spare Servers and Maximum Spare Servers, they are only used by MPM Prefork, so you may not need to change them from the defaults. 0 -
@cPanelMichael I think you can mark this one solved. The workaround described here seems to work just fine. 0 -
@cPanelMichael I think you can mark this one solved. The workaround described here seems to work just fine.
I'm happy to see the workaround was helpful. We'll hold on marking this thread as solved until the following feature request is implemented: Support MPM Event and MPM Worker In Apache Global Configuration Thanks!0 -
My issue with Enent MPM and Cpanel is I can't find any good docs from Cpanel on how to optimize this MPM and where to find the defaults that Cpanel uses so we may optimize it for different scenarios even from CLI! 0 -
The links to the feature request don't work anymore. I created a new one, but the new system doesn't tell me the link to it, so i assume it's "pending consideration"
Please fix this, because the "double save" trick is not a feature, it's a bug. Plus, the settings can be confusing when multiple admins are working on a particular Apache setup, especially if there is a time-gap between those admins who work on the server. They risk losing the desired config by using WHM to something that was manually configured.
0 -
Matt Lundstrom - we've completely revamped our features site since this thread was created 4 years ago, so the link isn't going to work. If you created a new feature using the "Submit Idea" button in the top right we'll see it on our end, but it will not display publicly unless we add it to the page.
If you're seeing a problem with the interface that wouldn't be a feature but an issue with the product. Can you get me more details on what you're experiencing?
0
Please sign in to leave a comment.
Comments
14 comments