[KLUG Members] Limiting user's CPU and resource usage

Adam bultman adamb at glaven.org
Wed Jun 21 16:11:44 EDT 2006


I've been tasked with trying to figure out how to limit the amount of
resources that a user is allowed to consume on a given linux server. 

Please note, this isn't a hard ceiling of 'how much CPU time can a
person use', or 'how much RAM can a person use', so using the stuff in
pam_limits or /etc/security/limits won't work. What I need to do is let
all users (in some cases, 120+) use the server without 'hogging' the
CPUs (I'd LOVE to limit disk accesses in blocks per second,too!).  So,
user 'adam' can use  up to 80% , while user 'developerguy' is allowed to
use 14%, because he often writes bad code that hogs the cpu. User 'root'
has free reign,  and 'scriptrunner' is relegated to 7%, because he's a
jerk and runs CPU-intensive programs during the day, affecting everybody
else.

I've done a bunch of googling, and I've found kernel patches and the
like, but none of them are for newer (> 2.4.14 or =~2.6) kernels. Most
of them are for 2.2.x and earlier 2.4 kernels, which one won't find on a
newer (Centos or Fedora) system.  I DO have a few RH6.2 and RH7.3
systems, but those are best left alone, kernel wise, if you ask me.

So, at this point, I have no options - or usable options - that I can
find (and no, installing BSD is not an option.)  Are there userland
programs, or other daemons I can run that  will throttle users, or at
least change the scheduler (obviously requiring a patched kernel) that
is stable that will do what I need here? It'd seem odd if it didn't
exist yet.

Adam


More information about the Members mailing list