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.

CPU / MySQL queries limitations per user

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

  1. mihai.aldea

    mihai.aldea Registered

    Joined:
    Jun 16, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    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

    Joined:
    Jun 28, 2006
    Messages:
    86
    Likes Received:
    1
    Trophy Points:
    8

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

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  4. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    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
     
Loading...

Share This Page