Note: You are currently viewing my old web site. There is a new version with most of this content at OJB.NZ. |
(Up to OJB's Mac Terminal Tips List Page) Change Process PrioritySome processes (or programs) might need to run for long periods on your machine while you are doing other work without making other programs slow. For example you might be running a distributed network data processing program like SETI@Home. Alternatively, there may be programs which need more of a share of the CPU to make sure they don't "skip", for example CD writing software like Toast or music software like iTunes. Changing the process priority can help with this. First you need to find out the process ID. To do this use the ps or top command. See the related commands section for information about these. Use ps -axc and find the process ID of the required process (its the number in the first column). Now use the renice command to change the process priority, type renice p xxx where p is the new priority and xxx is the number of the process to change. The priority can be a number between -20 and +20 where -20 is the highest (it goes faster) and +20 is lowest (only runs if other programs don't need to). Standard users can only make programs run slower but you can use sudo to give you privileges to make things faster. For example sudo renice -10 665 will change the privileges of process 665 to -10 (assuming it started at the default, 0, it will go faster). To check the current nice values of running processes use the ps -axcl command. The column titled "NICE" (or just "NI" is there is less space available) shows the nice value. Update: Modern systems with multiple fast cores are unlikely to be affected significantly by one or more processes using too much CPU time. If a process is dong this it might not be running correctly so don't just try to hide the problem using nice, which probably won't help much in that situation anyway! More information: Getting Started. Related commands: Viewing Running Processes, Top Processes. Comment on this page: Very Useful • Quite Useful • Useless or: View Results |