Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

ulimit for cpu annd memory

Discussion in 'Workarounds and Optimization' started by vmicovic, Jun 3, 2015.

  1. vmicovic

    vmicovic Well-Known Member

    Joined:
    Sep 4, 2007
    Messages:
    95
    Likes Received:
    0
    Trophy Points:
    56
    Hi,

    i wondering is there possibility to limit user resources (cpu and ram) with ulimit?
    in /etc/profile to add limit like this:
    Code:
    LIMITUSER=$USER
    if [ -e "/usr/bin/whoami" ]; then
            LIMITUSER=`/usr/bin/whoami`
    fi
    if [ "$LIMITUSER" != "USERNAME" ]; then
            ulimit -n 10 -u 5 -m 200000 -d 200000 -s 8192 -c 200000 -v unlimited 2>/dev/null
    else
            ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000 -v unlimited 
    2>/dev/null
    fi
    
    so, this USERNAME cannot start more then 5 process ?



    tnx.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice