39.11 Changing a Job's Priority Under BSD UNIXOnce a job is running, you can use the renice (8) command to change the job's priority:
% where priority is the new nice level ( 39.9 ) for the job. It must be a signed integer between -20 and 20. pid is the ID number ( 38.3 ) (as shown by ps ( 38.5 ) ) of the process you want to change. pgrp is the number of a process group ( 38.3 ) , as shown by ps -l ; this version of the command modifies the priority of all commands in a process group. uname may be a user's name, as shown in /etc/passwd ; this form of the command modifies the priority of all jobs submitted by the user. A nice level of 19 is the "nicest": the process will run only when nothing else on the system wants to. Negative values make a process get a greater percentage of the CPU's time than the default niceness (which is 0). Again, only the superuser can lower the nice number (raise a process' priority). Users can only raise the nice number (lower the priority) and can modify the priorities of only the jobs they started. BSD UNIX systems automatically nice jobs after they have accumulated a certain amount of CPU time. This implicitly gives priority to jobs that don't run for a long time, sacrificing users who run long jobs in favor of users who run many short commands. The autonice time varies from system to system, but is usually 10 CPU minutes. - |
|