Changing Priority Values for process/scripts

Changing priority of process/or running script :
-------------------------------------------------
Use top or ps
------------------------------------------------
eg. ./myscript.sh
#ps -ef | grep myscript
get the process id...
eg.4545
#ps -o pid,comm,nice -p 4545            //pid,,comm=command,nice=nice value of process , -p = processid, -o = outputformat

#ps -efl     <displays nice values>
....
......
#renice -15 -p 4545

// / nice value ranges from -20 to 19 ..negative value have higher priority(eg.-20 is highest priority and 19 have lowest , default priority is 0)
==============================================
To set nice value/ priority for process/script/cmd to be started
======================================================
#nice -n 10 apt-get upgrade
#nice -n -11 ./myscript.sh

No comments:

Post a Comment