General
cancel
Showing results for 
Search instead for 
Did you mean: 

Question about relation between nice value and %CPU

papoon
Occasional Contributor

Question about relation between nice value and %CPU

Hi HP UX Expert,

I would like to ask why a process with nice value of 20 can be allcoated more cpu power than those with nice value of 15 (See the attachment). What is the relation between nice value (NI) and priority (PRI) and %CPU? Is the NI is invertedly proportional to priority ? Why processes with same NI can have different PI? Please advise.

Thanks milliion!
Anthony
3 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Question about relation between nice value and %CPU

It depends on what the two processes are doing. Processes that the kernel determines are unmutual get lower priority.

Typically CPU bound processes get their priority lowered by increasing the PRI value.
http://docs.hp.com/en/B2355-60130/nice.1.html
Kranti Mahmud
Honored Contributor

Re: Question about relation between nice value and %CPU

Hi Papoon,

read this: http://en.wikipedia.org/wiki/Nice_(Unix)

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Emil Velez
Honored Contributor

Re: Question about relation between nice value and %CPU

priority is what the priority of the process is.

Nice value is used to determine how quickly its priority increases when it is waiting for the CPU.

If the program with a nice value of 15 does a lot of I/O it will generate a I/O request and then wait till it finishes where a CPU bound program with a nice value of 20 might get cpu since there is nothing else using the cpu.