Web Hosting Talk







View Full Version : Script causing ENORMOUS CPU load! :(


Eagle
07-23-2001, 11:28 AM
I have a customer on a RaQ that runs a script that uses almost 100% (!!) of the RaQ4's crappy 450Mhz CPU....

Now, I know there is a way to cap the script, not INSIDE the script, but a kernel thing,
so he can max use say 20% or so....

But....HOW? :eek:

magnafix
07-23-2001, 11:45 AM
This link may help:

http://www.google.com/search?hl=en&safe=off&q=linux+cpu+limits.conf

Of course, unless you're using sbox or suexec you may only be able to limit the CPU of apache, not one customer script.

May want to check your terms and conditions to make sure you have a "users are prohibited from doing anything which degrades performance" etc etc.

Eagle
07-23-2001, 11:52 AM
okay

/etc/security/limits.conf

This allows me to limit the amount of TIME a user can use the CPU for (per session)...
Is there also a way to make it a % max?:confused:

Planet Z
07-23-2001, 11:55 AM
Eagle, as stated above that might not help. CGI scripts often run under the Apache username (often nobody), not the actual user's username.

Check to make sure it's running under the customer's username first.

Eagle
07-23-2001, 11:56 AM
it IS :D