Nice

A small post how to tell processes to be nice to eachother. So yet again another addition to the entry about processes.

As the *nix systems do multitasking to handle their processes, there also has to be a system where it is possible to prioritize certain processes. This can be done thru the commands nice and renice.

The priority can be set within a range from -20 to 19. Where -20 is the most favorable scheduling. An easy way to remember is to think about gravity. The more weight you have, the lower you float, and the lower you are on the priority list.

So what’s the difference between the two commands;
– The nice command can be used to give a weight to the process when launching this process.
– The renice is to be used when an already active process needs to be re prioritized.

For example:
nice -n 10 /foo/bar
renice -p $PID -n 10

This small bit of knowledge can help you tune the process management of you system. Thus tune your server to be more effecient, as the important processes get more system resources.

One thought on “Nice

  1. Pingback: Erin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.