logo

Home page
Articles for Windows, Linux, OS X
Mac tips and articles
Mac tips
Windows 8 tips and articles
Windows 7 tips and articles
Vista Tips
XP Tips
Linux tips and articles
Read the blog
Online store
Windows, Linux, OS X programs
Links
About

Change the priority of programs

At one time and operating system used to run a single program at a time. If more than one needed to run then the first ran and the others waited until it had finished its task, then the second one ran, and the third, and so on. As operating systems became more sophisticated they gained the ability to run more than one program at a time. For example, you might have music playing in the background while you browse the web or type out a document in a word processor.

The way that an operating system runs more than one program at a time is to constantly switch from one to another. So it switches to one program and spends a little time running it, then switches to another and spends a bit of time running that, then it switches to something else, and so on. Each program gets a small slice of processor time.

Many programs can run at the same in Linux and each one gets a small proportion of the processor time. Mostly programs play fair and each gets an equal share of the CPU. However, sometimes a program will demand more time or will spend less time running. It's called the priority. High priority programs are allocated more processor time and low priority programs are allocated less processor time.

If a program gets more processor time, it will run faster because more time is spent running it. However, this means that less processor time is left for everything else and so other programs will consequently run more slowly. Sometimes this is useful and if you want a task finished as quickly as possible and you don't want to do anything else at the same time, you can increase the priority.

A program may have a high priority and demand so much processor time that other programs or Linux itself becomes slow and unresponsive. This is undesirable and for this reason you might want to lower the priority of a program. A low priority can be used to run a program in the background while you get on with something else.

Linux change program prioritySo how do you change the priority of a program? It's actually quite easy. Run System Monitor (on the System, Administration menu in Ubuntu and similar distros).

Select the Processes tab and you'll see all the processes (programs) that are running. The Nice column is the one that shows the priority - how big a share of the processor's time is allocated to it.

Zero is the normal value and this doesn't mean that it gets zero time. The range is from -20 (highest priority) to +20 (lowest priority) and so zero is in the middle.

Run Firefox and then look for it in the Process Name column. Right click Firefox and select Change Priority. You'll see a slider that enables you to change the priority from -20 to 20. Change it a little, to + or -5 for example. Click Change and you'll see the new value in the Nice column.

It's usually best to leave the priority settings to Linux, but with care, you can make a program run faster or make Linux more responsive by reducing processor hogs.

Go to Linux tips index...

copyright