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.

Limit FCGI Processes

Discussion in 'cPanel Developers' started by GrG, Jan 25, 2009.

  1. GrG

    GrG Registered

    Joined:
    Nov 11, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    on my cluster i'm using FCGI, and i want to set limits on processes number, memory usage and cpu usage.

    I've tried many many ways, but any of them seems to be working.

    Here are some examples:

    ---
    /home/USER/.profile

    ulimit -t 3 -u 1

    - Also with this setting, if i try to reload many times an user page i can see douzens of php processes
    ---

    ---
    /etc/profile

    GID=`id -g`

    if [ "$LIMITUSER" != "root" ]; then
    ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v 200000
    2>/dev/null
    elif [ "$GID" -gt "500" ]; then
    ulimit -n 100 -u 20 -m 40000 -d 40000 -s 8192 -c 40000 -v 40000 -t 10
    2>/dev/null
    else
    ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v
    unlimited 2>/dev/null
    fi

    - Same as above, this seems to be ignored
    ---

    ---
    FCGI Wrapper:

    #!/bin/sh
    ulimit -u 2 -m 40000 -d 40000 -c 40000 -v 40000 -t 10
    exec /usr/local/cpanel/cgi-sys/php5

    - Still seems being ignored
    ---

    So, how do you limit resources to users?

    Thankyou

    GrG
     
  2. h4f

    h4f Well-Known Member

    Joined:
    Jun 5, 2007
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Did you find any solution?

    cpanel adds more and more unwanted and unneeded options for end-users that kills a server in no time, resource limit is needed.
     

Share This Page