1833582 Members
3523 Online
110061 Solutions
New Discussion

Process Priority Issues

 
Lalit Seth
Frequent Advisor

Process Priority Issues

Hi,

I am having a Multi-Threaded Daemon running on HPUX 11.11.

I can see in 'top' that its PRIORITY is somewhere near 236-255 with NICE vlaue at 20.

There are other process running at priorities at 154, 156 but my daemon always remain at top of the list.

Why?

Also i witnesssed that after few minutes of execution the PRIORITY is changed to 152.

Why?

Many Thanks
10 REPLIES 10
bhavin asokan
Honored Contributor

Re: Process Priority Issues

hi,

top is having a vunerability problem.it will not show multithreaded daemons properties properly(cpu %,etc).use glance to see the same process.

regds,
Lalit Seth
Frequent Advisor

Re: Process Priority Issues

Thanks.

But what about the priority.

Why does it change from 242/255 to 152.

As 153 lies between 128-153 which is priority for Kernel Process.

Many Thanks
Lalit Seth
Frequent Advisor

Re: Process Priority Issues

Hi all,

Is there any system call through which i can set the Priority for my Daemon?

Many Thanks
Lalit Seth
Frequent Advisor

Re: Process Priority Issues

Hi,

I have tried various calls to get the Prioirty like sched_getParame(..), getprioirty() etc but all these calls comes back with the Nice(NI) value but not the Priority(PRI) as displayed in 'top'.

How can i get the PRI Value of an process and if possible how can i change the same

Many Thanks
Lalit
Sridhar Bhaskarla
Honored Contributor

Re: Process Priority Issues

Hi Lalit,

CPU scheduling it little complicated. The priority allocation is dependent on extra polation of how much the process is using the CPU. For ex., during the time share schduling, a clock tick is given to a process. If that process doesn't use the CPU in certain consecutive ticks, it's future priority will be degraded. Similarly, the priority will be increased if the process is using the CPU heavily during it's clock ticks. If the process does certain kind of IO, then it will be given a non signalable priority which is between 128 and 153.

To change the priority, you will need to use 'nice' or 'renice' commands. Only root will be able to increase the priority (decrease the nice value)

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: Process Priority Issues

Hi (Again),

If you want to allocate more CPU resources to certain processes and less to some other, I suggest you use PRM (Process Resource Manager) instead of altering the priorities. That's a good way of controlling the resources.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steve Lewis
Honored Contributor

Re: Process Priority Issues

man 1 rtprio for operating system command.
man 2 rtprio for system call

This command will set your priority.
It can be quite dangerous using real-time priority, because your process can end up running at a higher priority to some system processes and cause all kinds of problems that you don't want. You must test it most thoroughly and enquire as to the status of s/w support if you turn it on.
Lalit Seth
Frequent Advisor

Re: Process Priority Issues

Thanks sri.

It seems that there is no way to change prioirty either by any tool or system calls.

Steve,
the real time process priority are between 0-128. As these are much lower that that of System and User process hence will lead into more time consumption from CPU. (I might be wrong here).

Sridhar Bhaskarla
Honored Contributor

Re: Process Priority Issues

You can lower the priority as a user. But you cannot increase it unless you are root.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Lalit Seth
Frequent Advisor

Re: Process Priority Issues

Sri,
I can lower the priority of process by using nice / renice statements or is there any other way of doing the same.

may be rtprio etc

Thanks