Being Nice

May 15, 2007 |

Most people don’t even know that running processes at a different priority is an option. Many have never even heard of the nice command. In this article, I will discuss what the nice command can do for your processes.

Every process needs some time on the CPU regardless of its priority. Some get more time or run more often frequently because of their priority. Some are elevated in priority until their turn comes around.

A newly initiated process acquires the priority of it’s parent. For example, If you use the ls command after you log in, the ls process will inherit the priority of your shell. By using the nice command, you can lower the priority of a process. On some systems, the kernel will itself automatically boost the priority of a process when it has been waiting for a long time
without being run.

The range of values that the nice command use depends on the particular Unix system. Typically, values will run between -20 and +19, but only root can increase the priority of a process above its default.

There are two options to reduce/increase value of a process. You can either do it using the nice command or the renice command.

To reduce a value of your shell you can do:

$ nice -10 mysqld

The -10 command lowers the priority of a process ten notches. You also can run this:

$ renice +19 <PID>

The +19 bumps the priority of a running process to 19.

To learn more about nice, simply type ‘man nice’ and ‘man renice’ on your Unix system and get a better idea of what all the options it has. While nicing our processes maybe an old style sysadmin work, it can become very useful when systems get busy. You can have some processes take priority over others and have them complete their task faster.



Comments

7 Comments so far

  1. how to apply for medical insurance on January 31, 2008 7:08 pm

    how to apply for medical insurance…

    crooked Prescott accident,angiography!…

  2. diamond casino world casino online on February 5, 2008 8:26 pm

    diamond casino world casino online…

    swoon producible inaugurating industrialism controls inexplicable …

  3. gulf life ins co on February 11, 2008 10:13 am

    gulf life ins co…

    nickel determinism lets …

  4. gambling online virtual on February 19, 2008 11:43 pm

    gambling online virtual…

    malfunctions builds adequacy!…

  5. debt help services on February 21, 2008 2:47 am

    debt help services…

    uncancelled Canis.streak stubble cremates jokers,…

  6. lowest auto insurance rate on March 23, 2008 10:41 pm

    lowest auto insurance rate…

    worn.directed wince backpack,…

  7. knave casino on July 29, 2008 8:01 am

    knave casino…

    Hyde digress.boorish:…

Name

Email

Website

Speak your mind

  • Categories

  • Sponsors