Renice

From LXF Wiki

In Linux, as part of the multi-thread environment, all concurrently running processes are designated a priority level. This priority level allows, say, an urgent but infrequent process such as Watchdog processing, to take priority over a background application. All processes are assigned at startup either a default or elected **nice** level, between -20 and +20. The lower the **nice** value, the higher the priority.

Renice is the Linux built-in command that allows the user (usually super-user) to reassign the priorities (**nice** values). To see currently assigned nice values, type:

 $ top              # press Ctrl-C to exit screen

The NI column on resulting table is **nice** value of the running process. Note that most low-level daemons are nice level 0 - as in higher priority than most user applications, but not throttling the PC with a negative **nice** value.

To reassign the nice value, or a given programme ID (use top or ps to get this number), type (as super-user):

 # renice +1 1234           # Change process 1234 to nice value +1

The simplest way to allocate nice values, is to assign it at execution using the nice command.