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.

change php and apache priority

Discussion in 'Workarounds and Optimization' started by tiff2342, Aug 24, 2012.

  1. tiff2342

    tiff2342 Well-Known Member

    Joined:
    Apr 20, 2012
    Messages:
    140
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    is there a way when using fcgid to change php prirorty when they are spawned? cant it be done inw rapper script?

    what about apache?
     
  2. 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
    Could you explain why you need to change the priority and what you need to change them to for PHP and Apache?
     
  3. tiff2342

    tiff2342 Well-Known Member

    Joined:
    Apr 20, 2012
    Messages:
    140
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    I would like php (fcgid mode) and apache to have a -2 for example priority so they have a higher run level over everything else running
     
  4. 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 file that can be used for changing priority levels is /etc/security/limits.conf file, but it requires the following for changing the nice level:

    Code:
    username hard|soft priority #
    Here username is the USER field in top, hard is a hard priority while soft is a soft priority, and # is the value for the priority.

    The issue is that httpd is initiated as root user and then runs as nobody. If you try to set the level for nobody, it doesn't work and, if you set the level for root, it's going to basically impact all root processes.

    As for FCGI, I don't see any available options for this on the Apache directives page for it:

    https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

    I'm not saying it isn't possible to do it, but I am saying I cannot see a way currently that what you are wanting to achieve could be done.
     
  5. tiff2342

    tiff2342 Well-Known Member

    Joined:
    Apr 20, 2012
    Messages:
    140
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Thanks. I figured as much. I knew the big issue was due to services running as root ;/

     
Loading...

Share This Page