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!

CPU / MySQL queries limitations per user

Discussion in 'General Discussion' started by mihai.aldea, Jun 16, 2010.

  1. mihai.aldea

    mihai.aldea Registered

    Jun 16, 2010
    Likes Received:
    Trophy Points:
    We were recently hit by a new problem which we didnt see coming. We have a couple of cPanel/WHM instances running, one of which is hosting only two client accounts. Right until the last client was hosted there, the CPU load as at about 10%. After this guy hosted his website, due to the massive traffic he receives is keeping the CPU at 80-100% constantly. It's a decent machine, with a Q9850 CPU, 4GB of RAM etc.
    Since all our plans have unlimited traffic, we can't do anything about this abuse other that trying to limit his resource usage. So, is there any way to limit the CPU cycles that this user is generating through Apache and MySQL?

    We have optimized my.conf, recompiled Apache with MPM worker and a few other optimizations that don't come out of the box with a freshly installed WHM instance.

    Please let me know if there are any tricks to limit this massive resource usage.

    Thank you.
  2. xanubi

    xanubi Well-Known Member

    Jun 28, 2006
    Likes Received:
    Trophy Points:

    Use CloudLinux, it'll help resolve that problem.
  3. garrettp

    garrettp Well-Known Member

    Jun 18, 2004
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider
    I'm not really certain how that would help in any tangible way, but since you've bumped an old unanswered thread, I'll offer some suggestions.

    Before over-tweaking all of your daemons, first you should figure out what the load is. Is it all userspace CPU load? Or is it disk-bound I/O load? Are you swapping heavily (and thus generating excessive disk I/O load as well)?

    These stats can be gathered from a simple 'top' reading the values for %us (userspace CPU usage), %wa (percentage of the CPU time spent waiting on I/O, typically disk), and xxxkb used under the Swap: row.

    Once you get a better idea of where your resource bottleneck is, you can then formulate a plan of attack.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. InterServed

    InterServed Well-Known Member

    Jul 10, 2007
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider
    In MySQL 5.1, you can limit use of the following server resources for individual accounts:
    The number of queries that an account can issue per hour
    The number of updates that an account can issue per hour
    The number of times an account can connect to the server per hour
    The number of simultaneous connections to the server by an account

    Check the following link in regard to mysql limitation:
    MySQL :: MySQL 5.1 Reference Manual :: 5.5.4 Setting Account Resource Limits

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