1827594 Members
2596 Online
109965 Solutions
New Discussion

Renice the process

 
SOLVED
Go to solution
hangyu
Regular Advisor

Renice the process

I want to renice the process , so that the prioity of process 8365 higher than 16104 , can advise how to set it , what is the meaning of pri and ni , does higher value mean higher prioity ? thx

PID USER PRI NI
8365 root 15 0
16104 root 15 0
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor
Solution

Re: Renice the process

Hi:

The manpages for 'renice' answer your questions:

http://www.docs.hp.com/en/B2355-60127/renice.1M.html

Regards!

...JRF...
spex
Honored Contributor

Re: Renice the process

Hello,

Nice values are inversely proportionate to priorities. A higher nice value equates to a lower priority, as the process had been made "nicer".

PCS
Steven E. Protter
Exalted Contributor

Re: Renice the process

Shalom,

The thing to remember is that a lower priority is going to get more cpu.

Recognize that if a process is looking for I/O it really doesn't matter how much CPU it gets, its not going to do anything until i/o is complete.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: Renice the process

Priority will have virtually no effect on any process that talks to the network or to a disk. Once a program requests any I/O, priority has no effect. Priority only has significant meaning for programs that perform continuous calculations. The OS will evaluate continuously executing programs and adjust the priority to a higher number as the program consumes more CPU time. If there is only one program running like this, then the priority will continue growing (called priority decay) to the highest number. However, the program still runs continuously until something else needs to run such as a login.

Now if two programs (in a single CPU system) are running continuously, the OS will switch back and forth between the two programs based on the priority difference. Although there are some esoteric resource calculations made by the kernel based on each program's behavior, the most important metric is CPU time consumed.

Now these basic concepts only apply to normal processes where the priority is between 172 and 255, called user-level priorities. Specialized kernel routines and system calls run at system-level priorities 128 to 177. These system-level priorities to not get adjusted. Normal programs should never be set to system-level priorities.

There is another priority range (unique to HP-UX) called realtime priority called rtprio. This is reserved for very specialized processes such as ttisr which will show up as PRI = -32. The negative number has to do with internal kernel priorities which range from 0 to 767, and external priorities (such as ps -l) which range from -512 to 255.

Now the details are much more complex than this overview but suffice it to say that adjusting priorities seldom has the desired effect (ie, giving one process more or less time) for most applications. You can use nice or renice to adjust a process but whether it has much of an effect depends mostly on CPU cycles and not I/O. To adequately control applications that are competing for CPU and I/O, you'll need the Process Resource Manager.


Bill Hassell, sysadmin
Raj D.
Honored Contributor

Re: Renice the process

Hangyu,

You can use renice command to change the nice value of a running process.

In a nutshell the nice value scheme provides a facility where you run lengthy jobs at a lower priority while processes that are required to be completed in a short time are run at a higher priroty level.

# ps -efl , and check for the NI column to check the current nice value. All the procsses by default will have a nice value of 20.

So if you want to run a process with nice value higher than 20 , (suppose 30)you have to use:

# nice -10 newprog # (for new program/jobs)
( newprog will run at a nice value of 30 )

In your case to change the nice value of the running process (PID 8365 ):
use
# renice -n 5 8365

This will increase the nice value 5 more from the default value.


Cheers,
Raj.


" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: Renice the process

Hangyu , Happy new year. 2007!! ,

If the celebration is over , have a look and review your posted thread(s),

Cheers,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "