0 like 0 dislike
53 views
asked in Linux Forum by (13.4k points)  
recategorized by
How to change linux process priority if already running

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (13.4k points)  

Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process). To put this simply, the negative values (Eg. -20) gives higher priority to a process and positive values (Eg. 19) gives lower priority.

Sample output:

F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 T 1000 15059 14306 0 95 15 - 55815 signal pts/0 00:00:00 cmus
0 R 1000 15066 14306 0 80 0 - 8148 - pts/0 00:00:00 ps

As you see in the above output, cmus is running with lower priority value of 15.

To change the current niceness value of a running process, for example 18, run the following command:

$ renice -n 18 -p 15059

Here, 15059 is the process id of cmus process.

Sample output would be:

15059 (process ID) old priority 15, new priority 18

Verify the niceness value using command:

ps -al

Sample output:

F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 T 1000 15059 14306 0 98 18 - 55815 signal pts/0 00:00:00 cmus
0 R 1000 15074 14306 0 80 0 - 8148 - pts/0 00:00:00 ps

 

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
0 answers
Welcome to PostgreSQL Database Discussion Forum where you can ask questions and receive answers from other members of the community. Can discuss here Oracle, Postgresql, mariadb , mySQL , AWS , Linux , MSSQL , MongoDB , Greenplum databases related queries ...etc.
...