renice functional in 10.1

Sep 25, '01 01:33:11PM

Contributed by: Iceberg

Readers will appreciate that the 'renice' command [Editor: This command changes the default CPU allocation of currently running tasks] appears to be fully functional in 10.1. I started two instances of the distributed.net client and then used 'top' to examine the CPU usage of each. Read the rest of the article if you'd like to see the results (and they're notably changed from what would be seen under 10.0.4!).

First example, both processes have the same priority (the default):

PID COMMAND      %CPU
634 dnetc 45.3%
629 dnetc 44.4%

The output varied a bit but never diverged much beyond an equal percentage for the two processes.

Second example, the first process is set at priority -20 (the highest) and the second at 20 (lowest) with the following commands:

sudo renice -20 634
sudo renice 20 629

Top will then show something like this:

PID COMMAND      %CPU
634 dnetc 70.5%
629 dnetc 20.2%

Previously, running renice showed no appreciable change in the percentage of CPU time a process used. This opens the door to further optimize performance in OS X in certain specific cases.

- Iceberg

Comments (0)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010925133311232