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!

Limiting a single client's website's cpu?

Discussion in 'Workarounds and Optimization' started by thepossum, Sep 26, 2017.

  1. thepossum

    thepossum Member

    Jun 19, 2014
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    We are running a cpanel server for multiple customers, generally with no issues. Apache, php, sql, etc all normally run smoothly. The machine's normal cpu load is on the order of 0.30, and is very well responsive

    ONE client has a website designed in php, in such a way that when it is accessed repeatedly and rapidly, such as when it is being re-indexed by a webcrawler, the multiple simultaneous web accesses drive the cpu load up to 4.0 and higher, slowing the entire machine down if I let it climb further.

    A bit of googling suggests that I can set per-username limits via /etc/security/limits.conf for "priority" and/or "nice". And my minor bit of testing shows that any such limits I add there take effect immediately upon a new login.

    But the Apache httpd process does not pass such limits down when it forks. The php process is seeming to be running with Apache's own niceness (0), and not what I define in the limits.conf file. "top" shows that the "NI" for their php processes remains at 0, the "PR" column shows either 16 or 17, regardless of whether I set theirs to 5 or 19.

    All the other websites on this server are "well behaved"; what can I do to limit the impact of a single user's poorly written php, without affecting everybody else's?
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    A third-party application such as CloudLinux is typically the best approach to prevent one account from using up an excessive amount of resources on a server. You can read more about this at:

    CloudLinux - Main | New template

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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