[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: cpu amount




Ok, I'll bite...
On Fri, 17 Nov 2000, [iso-8859-1] Thomas Jørgensen wrote:

> This is NOT the answer!
> 
> It is sick to see stupid monkeys answering reasonable questions with a
> "man foo(1)" when they don't understand the question or don't
> understand the man page to which they refer.
> 
> nice(1) addresses the scheduling priority, which in turn means the
> ordering in which processes gets to run.  Rafael asks about how to
> reserve a percentage of the CPU cycles, and it is a, though related,
> totally different question.
> 
> The short answer is: You can't!

I think the discussion, should be, why does he need 20% idle time? If it
is a more general issue of users eating up to much CPU time he has the
option of setting limits in their shell (and of course there is always the
option of making the pay for CPU usage). 

[snip]

> Another weakness in the UN*X scheduling system is, that it is not
> possible to limit the number of process slots a user can get.  So a
> fork bomb (a process that forks a number of children that in turn do
> the same) can really bring a system to it's knees and mostly require
> a reboot.

Wrong. setrlimit(2) (it appeared in 4.2) provides exactly this
functionality. This is not a weakness of UN*X in general but more a
limitation on certain implementations thereof. All of the  shells
provide access to this through something like ulimit (in sh derivatives,
limit in csh descendents). 

> For further discussion of the topic refer to "The Design of the UNIX
> Operating System" by Maurice J. Bach and maybe to "The Design and
> Implementation of the 4.4 BSD Operating System" by Marshall Kirk
> McKuisick, Keith Bostic, Michael J. Karels, and John S. Quarterman

For a more modern overview of Unix algorithms (scheduling, filesystems,
and such) "Unix Internals" by Uresh Vahalia (Prentice Hall, 1996).

> --
> Thomas Jørgensen, UNIX instructor and consultant.
> SuperUsers A/S, Karlebogård, Karlebovej 91, DK-3400 Hillerød.
> 
> 
> > -----Original Message-----
> > From: Jan Muenther [mailto:jan@radio.hundert6.de]
> > Sent: Friday, November 17, 2000 9:43 AM
> > To: Rafael Coninck Teigao; misc@openbsd.org
> > Subject: Re: cpu amount
> > 
> > 
> > >     Is there anyway to limit the amount of CPU that a 
> > process uses? Say
> > > I want to always let my CPU 20% idle, is there a way to a make be
> > > limited?
> > 
> > man nice
> > -- 
> > Radio HUNDERT,6 Medien GmbH Berlin
> > - EDV -
> > j.muenther@radio.hundert6.de
> > 
>