The backticks are used in the previous command line to indicate that the output of the pgrep command (presumably PIDs of spamd daemons run by chris) is fed to the renice command. # renice -3 "pgrep -u chris spamd" Renice chris' spamd processes -3 9688: old priority -1, new priority -3Ģ0279: old priority -1, new priority -3 20282: old priority -1, new priority -3 $ renice +2 -u francois Renice francois' processes +2 Here are some examples of the renice command: When a process is already running, you can change the process's nice value using the renice command. # nice -n -10 gimp Launch gimp at higher priority $ nice -n 12 nroff -man a.roff | less Format man pages at low priority Here are a few examples of starting a command with nice to change a command's nice value: This can possibly crash your machine if critical system processes lose their high priority. WARNING! Proceed with caution when assigning negative nice values to processes. Although the root user can raise or lower any user's nice value, a regular user can only lower the priorities of a process (setting a higher nice value). The priority number can range from -20 (most favorable scheduling priority) to 19 (least favorable scheduling priority). You can use the nice command to run a process at a higher or lower priority than the default. $ nice Run nice to determine current niceness To see your current nice value, you can type the nice command with no options: Niceness doesn't enforce scheduling priority, but is merely a suggestion to the scheduler. The concept came about during the days of large, multi-user Unix systems where you could be "nice" by running a non-urgent process at a lower priority so other users had a shot at the CPU. Positive values of niceness actually give your process a lower priority. Adjusting Processor Priority with niceĮvery running process has a nice value that can be used to tell the Linux process scheduler what priority should be given to that process. Likewise, the pkill command can send a signal to a process. The kill and killall commands can be used to send signals to running processes. With the nice command, you can determine the default priority and also set a higher or lower priority at the time you launch a process.Īnother way you can change how a running process behaves is to send a signal to that process. With the renice command, shown earlier, you can adjust a running process's priority in your system's scheduler. Even after a process is running, you can change its behavior in different ways.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |