Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
help:general_linux:priority [2016/05/18 11:35]
jebailie
help:general_linux:priority [2017/12/30 20:54]
mlsmith [NICE & RENICE]
Line 2: Line 2:
 ====== System Priorities ====== ====== System Priorities ======
  
-Priorities are something ​you usually don't have to worry about on our system. However, if you're running a particularly computationally complex algorithm for a period of time, other users may be adversely affected. This is more of an issue if you are running on mote33 than on the lab '​Pizzabox Suns.' So, if you need to know how to make your big, bad program play nice with the other children, this page is for you.+Priorities ​of programs ​are something to be aware of.
  
 ===== PS ===== ===== PS =====
Line 14: Line 14:
 ===== NICE & RENICE ===== ===== NICE & RENICE =====
  
-Now, to make your process run with a different priority than normal, there are the ''​nice''​ and ''​renice''​ commands. For a process already running, the renice value will change the priority. For example, to change the priority of a running process from the standard 20 to 25 (so that it runs after the other processes in the queue,) first use ''​ls''​ to get the PID. Let's say the PID is 941. Then, type ''​renice -n 5 -p 941''​ Alternatively,​ if you know a process should run at a lower priority when you start it, the ''​nice''​ command will start it off with a lower priority. The easiest way is to use the default ''​nice''​ value of 4 lower than your terminal NIce value. For example, ''​nice a.out''​ should start a.out at a NIce value of 24 if you haven'​t changed your terminal NIce value.+Now, to make your process run with a different priority than normal, there are the ''​nice''​ and ''​renice''​ commands. For a process already running, the renice value will change the priority. For example, to change the priority of a running process from the standard 20 to 25 (so that it runs after the other processes in the queue,) first use ''​ps''​ to get the PID. Let's say the PID is 941. Then, type ''​renice -n 5 -p 941''​ Alternatively,​ if you know a process should run at a lower priority when you start it, the ''​nice''​ command will start it off with a lower priority. The easiest way is to use the default ''​nice''​ value of 4 lower than your terminal NIce value. For example, ''​nice a.out''​ should start a.out at a NIce value of 24 if you haven'​t changed your terminal NIce value.
  
 So, now you know all about how to deal with processes and their priorities on our system. For more information,​ check the man pages (you can run man through the emacs Help menu, off this web page ([[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​ps|ps]],​ [[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​kill|kill]],​ [[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​nice|nice]],​ [[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​renice|renice]]) or from a terminal with the ''​man''​ command.) So, now you know all about how to deal with processes and their priorities on our system. For more information,​ check the man pages (you can run man through the emacs Help menu, off this web page ([[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​ps|ps]],​ [[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​kill|kill]],​ [[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​nice|nice]],​ [[http://​wiki.cs.vassar.edu/​cgi-bin/​man/​man2html?​renice|renice]]) or from a terminal with the ''​man''​ command.)