The scheduling priority is an integer value, from 20 (highest priority) to +20 (lowest priority). By default, the bash shell starts a process of 0 for all priority processes!
Nice command: nice-n
The nice command can set the priority when the command is started!
[Email protected] ~]# nice-n/test39.sh > Test39out &
[1] 7753
[[Email protected] ~]# PS AL
F UID PID PPID PRI NI VSZ RSS wchan STAT TTY time COMMAND
4 0 2151 1 0 1664 420-ss+ tty1 0:00/sbin/mingetty
4 0 2162 1 0 1664 420-ss+ Tty2 0:00/sbin/mingetty
4 0 2167 1 0 1664 424-ss+ tty3 0:00/sbin/mingetty
4 0 2170 1 0 1664 420-ss+ Tty4 0:00/sbin/mingetty
4 0 2173 1 0 1664 420-ss+ tty5 0:00/sbin/mingetty
4 0 2203 1 0 1664 420-ss+ tty6 0:00/sbin/mingetty
4 0 6904 6902 0 5080 1640 wait Ss pts/1 0:00-bash
0 0 7753 6904 4736 992 finish TN pts/1 0:00/bin/bash./tes
4 0 7754 6904 0 4460 812-r+ pts/1 0:00 PS al
[1]+ Stopped nice-n/test39.sh > Test39out
Renice command
Change the priority of a command in a running system
[Email protected] ~]# renice 9-p 7753
7753:old priority Ten, new priority 9
[[Email protected] ~]# PS AL
F UID PID PPID PRI NI VSZ RSS wchan STAT TTY time COMMAND
4 0 2151 1 0 1664 420-ss+ tty1 0:00/sbin/mingetty
4 0 2162 1 0 1664 420-ss+ Tty2 0:00/sbin/mingetty
4 0 2167 1 0 1664 424-ss+ tty3 0:00/sbin/mingetty
4 0 2170 1 0 1664 420-ss+ Tty4 0:00/sbin/mingetty
4 0 2173 1 0 1664 420-ss+ tty5 0:00/sbin/mingetty
4 0 2203 1 0 1664 420-ss+ tty6 0:00/sbin/mingetty
4 0 6904 6902 0 5080 1640 wait Ss pts/1 0:00-bash
0 0 7753 6904 9 4736 992 finish TN pts/1 0:00/bin/bash./tes
4 0 7762 6904 0 4460 840-r+ pts/1 0:00 PS al
This article is from the Linux Operations sharing blog, so be sure to keep this source http://liangey.blog.51cto.com/9097868/1575061
Nice and renice scheduling in Linux takes precedence