Re: what's this "nice" unix thing?

Trent Piepho (
Fri, 23 May 1997 10:38:41 -0700 (PDT)

On Fri, 23 May 1997, Collin Ong wrote:
> But if I run another computationally intensive process, deschall drops to
> about 30% and the other process gets 70%. Since the other process is
> likely to be a silicon simulation or something important, slowing this
> down with the deschall process is not acceptable.
> Am I doing something wrong or is there no way to get deschall to drop to
> single digit CPU % when something else runs. Most normal processes run
> at NICE level 0.

On my machine a fully niced process and a normal process will split the CPU
about 8% and 92%. It depends on your OS.

> Can anything be done to further lower deschall's CPU usage when something
> else is running? If so, I can get a bunch of workstations on the task
> this weekend.

One thing you can do is write a program to monitor load average, and when it
gets too high puase deschall. Load average is a running average of the
number of processes on the run queue. A CPU intensive program (that means
it will as much CPU time as it can get) like deschall will bring the load
average to 1. Another CPU hog will make it go to 2, and so on. So if say the
load average gets above 1.5, pause deschall. You can pause a program by
sending it a STOP signal and start it up again with a CONT signal. How
exactly you get the load average depends on your OS. On linux you can
just read it from /proc/loadavg. If you need to, you could just run uptime
and parse its output.

|Gazing up to the breeze of the heavens \ on a quest, meaning, reason |
|came to be, how it begun \ all alone in the family of the sun |
|curiosity teasing everyone \ on our home, third stone from the sun. |
|Trent Piepho ( -- Metallica |