The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

where is MPM Worker Setting?

Discussion in 'Workarounds and Optimization' started by Massoud, May 10, 2011.

  1. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I recently compile Apache with MPM Worker and I want to change the default thread setting, where can I add my setting and where is the worker configuration default setting, via WHM panel/ Apache Configuration I can see MPM Prefrek setting, and when I add

    <IfModule worker.c>
    ServerLimit 16
    StartServers 2
    MaxClients 250
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 500
    </IfModule>

    in Apache httdp.cnf got lots error

    Please help me
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    Go to WHM >> Service Configuration >> Apache Configuration >> Global Configuration for making the changes.
     
  3. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for answering but these global configuration are just for MPM prefork and you can not modify maxaparethread and or threadsperchids
     
  4. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, that's true. These 2 are extra parameters. You just need to ass those parameters. Can you post the error message you are receiving while restarting Apache?
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you are adding additional settings beyond those provided in WHM > Apache Configuration > Global Configuration area, you would want to add them using one of the include files rather than directly into /usr/local/apache/conf/httpd.conf file. The best include file to use would likely be /usr/local/apache/conf/includes/pre_main_global.conf one.

    You can likely just input the following without putting the tags around them:

    Code:
    ServerLimit 16
    StartServers 2
    MaxClients 250
    MinSpareThreads 25
    MaxSpareThreads 75
    ThreadsPerChild 25
    MaxRequestsPerChild 500
    After adding the settings, then run the following commands:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110510
    /usr/local/cpanel/bin/apache_conf_distiller --update 
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    At that point, you could re-check /usr/local/apache/logs/error_log to see if you show any errors.
     
  6. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your answers, Could you please show me how can I find current mention setting and their variables, I mean is there any command to figure out the current setting and their variables.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The current settings are in WHM > Apache Configuration > Global Configuration area for the ones that cPanel has available. The others would be the defaults by Apache, which won't be listed if you haven't configured them. You'd have to review the Apache documentation site to see what any defaults would be for your Apache version:

    worker - Apache HTTP Server

    If you click on something like MaxClients on that page, it takes you to:

    mpm_common - Apache HTTP Server

    Here it details that the default for hybrid MPMs is 16 for MaxClients. If any setting is not already configured, it would take the default value.
     
  8. erick_paper

    erick_paper Well-Known Member

    Joined:
    Apr 19, 2005
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    16
    Hi. I am thinking of worker MPM too (why doesnt cpanel make them a default now that are stable and MUCH better than prefork for performance on medium to large websites!) -- but there's the issue of PHP. Is there any guide on setting up MPM + mod_fcgi (php) + the usual mod security/mod geoip etc? Thanks!
     
  9. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    I know this is an old thread, but this contains exactly what I was looking for... I think.

    I am using the event mpm. The current settings in my httpd.conf show :


    # These can be set in WHM under 'Apache Global Configuration'
    Timeout 300
    TraceEnable Off
    ServerSignature Off
    ServerTokens ProductOnly
    FileETag None
    StartServers 5
    <IfModule prefork.c>
    MinSpareServers 5
    MaxSpareServers 10
    </IfModule>
    <IfModule itk.c>
    MinSpareServers 5
    MaxSpareServers 10
    </IfModule>
    ServerLimit 256
    MaxRequestWorkers 256
    MaxConnectionsPerChild 10000
    KeepAlive Off
    KeepAliveTimeout 5
    MaxKeepAliveRequests 100

    My first question is... the min/max spare servers values are wrapped in if modules and only contain perfork and itk. Does that mean I am basically setting no values for these since I am using the event mpm?

    The second is in regards to adding custom values. I realize I can change these in WHM, but if the above is true not all of the values would affect my event mpm choice. The solution shown is to add them in the pre_main_global.conf. Since that adds the custom entries in the beginning, pre, wouldn't the other values already in the file (which are now below the custom ones in the include) overwrite them?
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, this is correct.

    Which values are you duplicating? For instance, if you want to modify the existing values, you can follow the instructions at:

    Global Configuration - Documentation - cPanel Documentation

    Thank you.
     
  11. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    For example, the values in the global configuration for WHM are always going to be added into your httpd.conf file. Right now mins shows :

    # These can be set in WHM under 'Apache Global Configuration'
    Timeout 300
    TraceEnable Off
    ServerSignature Off
    ServerTokens ProductOnly
    FileETag None
    StartServers 5
    <IfModule prefork.c>
    MinSpareServers 5
    MaxSpareServers 10
    </IfModule>
    ServerLimit 256
    MaxRequestWorkers 150
    MaxConnectionsPerChild 10000
    KeepAlive On
    KeepAliveTimeout 5
    MaxKeepAliveRequests 100

    BUT, I am putting the following in my pre virtual host include (because this include file comes AFTER the above in the httpd.conf file whereas the pre main include comes BEFORE them :


    <IfModule worker.c>
    StartServers 2
    ServerLimit 20
    MaxRequestWorkers 500
    MaxConnectionsPerChild 20000
    MinSpareThreads 75
    MaxSpareThreads 250
    ThreadsPerChild 25
    ThreadLimit 64
    KeepAlive On
    KeepAliveTimeout 2
    MaxKeepAliveRequests 100
    </IfModule>

    So, since my custom values entered in the include are going after the defaults... mine are the ones used right?

    Also, the other thing I noticed is, unless I am reading the apache docs completely wrong, it seems the global configuration values in WHM aren't being handled correctly... mainly the server limit and maxrequestworkers. In WHM, if I enter a server limit of 20 and maxrequestworkers of 500 it tells me 'maxclients: 500' is invalid and does not allow the value.

    According to apache the custom settings I listed above would allow for 500 concurrent connections (severlimit 20 * threadsperchild 25 = 500... which is why I set maxrequestworkers at 500. If that logic is wrong then please correct me... if not, then WHM (or atleast the error handling for the settings) is wrong when using anything other than prefork.
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You should be able to simple change the default values by editing the /var/cpanel/conf/apache/local file per:

    Global Configuration - Documentation - cPanel Documentation

    Is that not working? Please ensure you open separate threads for additional issues with the interface.

    Thank you.
     
  13. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    When using the worker or event mpm's these values have different meanings than when using prefork. I think it would be better to use these in an include with the ifmodule if possible rather than editing the defaults. With that said, including them in the file after those defaults is essentially the same thing right?
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Just so we are clear, are you referring to /var/cpanel/conf/apache/local?

    Thank you.
     
Loading...

Share This Page