CPU / MySQL queries limitations per user

mihai.aldea

Registered
Jun 16, 2010
1
0
51
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.
 

xanubi

Well-Known Member
Jun 28, 2006
86
2
158
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.

Use CloudLinux, it'll help resolve that problem.
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
Use CloudLinux, it'll help resolve that problem.
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.
 

InterServed

Well-Known Member
Jul 10, 2007
268
14
68
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