*BSD News Article 51444


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!recepsen.aa.msen.com!zib-berlin.de!news.tu-chemnitz.de!irz401!werner.sax.de!not-for-mail
From: j@werner.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: "An HTTP software server can pummel a CPU..."
Date: 14 Sep 1995 19:28:42 +0200
Organization: Private U**x site, Dresden.
Lines: 25
Message-ID: <439ooa$fdc@bonnie.tcd-dresden.de>
References: <gary-1309951409030001@bhb17.acadia.net>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Gary Robinson <gary@first.acadia.net> wrote:

>[ Now that I think of it, I maybe I do remember hearing before that Unix
>didn't allow priorities ].

Unix is considered a time-sharing o/s (as opposed to a real-time o/s)
and as such has no static priority handling (and hence no guaranteed
response time).  However, there is a mechanism to modify the initial
priority of a process, called "nice" (see nice(1) and nice(3)).

Further, the basics of the scheduler are arranged so that it would
lower the priority of processes that did consume much CPU, while it
will raise the priority of processes that used to have long sleep
times (i.e., were waiting for I/O to complete), in order to give them
a better interactive response behaviour.

You can also limit the amount of CPU a process will be allowed to get
_in total_, it will be killed after exceeding this amount (but you can
arrange it to send the process a SIGXCPU first).  See [sg]etrlimit(2)
and the csh-builtin command limit.
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)