Operating System - HP-UX
1820964 Members
4149 Online
109630 Solutions
New Discussion юеВ

Are Nice and Renice 'permanent?'

 
doug mielke
Respected Contributor

Are Nice and Renice 'permanent?'

Please help settle a debate before we take action based on what may be a flawed concept.

My understanding of Nice and Reniced processes is that they are still subject to Unix's process aging, where as the process gets older, it's priority will be raised in an attempt to get even low priority jobs some process time.

Thus, the effect of nice or renice on a process should be considered only temporary.

Eventually a process intensive job will still be at the head of the queue given enough time on the system.

Am I missing something here (again)? If so, please help enlighten me.
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Are Nice and Renice 'permanent?'

Doug,

The nice value is taken into account when calculating the priority, so the effect should be permanent.


Pete


Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Are Nice and Renice 'permanent?'

Once set by the nice() system call, the nice value remains constant; however, the nice value is but one of the factors which determine priority -- which does not remain constant. You can get a good idea of how nice() works by using renice on somed processes and then doing a series of ps -l's (or -el's, if you like) . You will note that the nice value remains constant but the priority value will change depending on how long it has been since this process last ran among other things.
If it ain't broke, I can fix that.
Pete Randall
Outstanding Contributor

Re: Are Nice and Renice 'permanent?'

Doug,

I was looking for some reference to quote you. What I came up with is from HP's "Theory of Operations for the PA-RISC HP 9000 Systems":

"The schedcpu() routine adjusts the p_pri field of the process structure that holds the value the system uses for scheduling. Factors that are used to determine this value include how much CPU time the process has used, the number of processes competing for the CPU, and the nice value (timeshare processes only)."

So, each time the priority is recalculated, the nice value is taken into account, making the effect permanent.


Pete



Pete
Steven E. Protter
Exalted Contributor

Re: Are Nice and Renice 'permanent?'

My performance book says nice and renice live as long as the process does.

By itself its only a factor in priority. There are lots of other thinks that need to go on on a Unix box.

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
MANOJ SRIVASTAVA
Honored Contributor

Re: Are Nice and Renice 'permanent?'

Hi Doug

Here is some intersting stuff :

http://www.itworld.com/nl/unix_sys_adm/04242002/

A newer job fired will take into consideration the older jobs running .



Manoj
doug mielke
Respected Contributor

Re: Are Nice and Renice 'permanent?'

Clay,
I've done just that in the past when trying to control some unruly processes, and after a few minutes, the process priority is as high as ever.

I'm sure that the nice setting doesn't change, and is permanent.

However, it seems the practical affect on my process will become nil after a period of time, unless nice places a limit on how high a process priority can be raised as it ages.

Has anyone heard of a limit like that?
Pete Randall
Outstanding Contributor

Re: Are Nice and Renice 'permanent?'

Doug,

I suspect you're right that, depending on the situation and load, "niced" processes can gain priority. The only limit is that they will remain in the time share run queues (178 thru 255).


Pete



Pete
harry d brown jr
Honored Contributor

Re: Are Nice and Renice 'permanent?'

You might want to look into PRM or WLM:

http://h30046.www3.hp.com/solutions/hpuxmanagement.html

of course I like to take care of unruley processes by killing them and yelling at the developer......fortunately I don't "charge" the mound......and for a good laugh about charging the mound: http://www.espn.go.com/page2/s/caple/031013.html

live free or die
harry
Live Free or Die