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.

User resource limits

Discussion in 'General Discussion' started by Machochito, Mar 20, 2010.

  1. Machochito

    Machochito Registered

    Joined:
    Mar 7, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,


    I want to limit cpu resources used for one user.
    As I know there is two methods for this task:

    1. /etc/security/limits.conf
    2. RLimitCPU and RLimitNPROC apache directives in Virtualhosts.

    Which method should I use, if I'm running php as fcgi?

    Thank you in advance.
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    #1 in your list will allow you set limits per domain / user though that is not really foolproof and you could still exceed those limits at times but that is a step in the right direction on what you asked.

    #2 in your list will setup a limit on everyone though it is good to set that to prevent Apache from overrunning your entire system

    If you are running SuPHP or FCGI, it makes things a bit easier since all user scripts are executed under the user id instead of the common username 'nobody' and in that case you could setup a process to cpulimit or renice processes spawned under that particular user.

    LFD (part of CSF) also has a few options that might interest you in that area though not directly what you asked there might also be useful.
     
  3. Machochito

    Machochito Registered

    Joined:
    Mar 7, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I have configured a limit with /etc/security/limits.conf.
    I have the following configuration:

    testuser - cpu 1

    But php5 processes whose owner is testuser still utilizes the cpu.
    There are three such processes each uses ~35% of cpu.
    So I thnik these limits are not working.
    Have someone experience with such coniguration?

    Thanks.
     
Loading...

Share This Page