Operating System - HP-UX
1833873 Members
1763 Online
110063 Solutions
New Discussion

How to increase the priority of a process (higher priority)

 
Ravi S. Banda
Regular Advisor

How to increase the priority of a process (higher priority)

I have oracle database import processes running on a system.

I'd like to increase the priorit. I already used renice because Processes with lower system nice values run at higher system priorities than processes with higher system nice values.

But, when I do a ps -elf|grep imp|grep -v grep, I see that 154 as PRI and 8 as NICE. 8 for the NI is good, but not 154. I need to run these imp processes at a higher priority.

Thanks!
Ravi.
6 REPLIES 6
IT_2007
Honored Contributor

Re: How to increase the priority of a process (higher priority)

Are you "nicing" the PID using root or not? Only superuser or equivalent to root user can renice the PID.

You can check using "glance".

Also check man nice

The difference between the system nice value
(relative priority) of the current (or parent)
process and the actual system nice value at which
command is to run.

An unsigned value increases the system nice value
for command, causing it to run at lower priority.

A negative value requires superuser privileges,
and assigns a lower system nice value (higher
priority) to command. If the current process is
not privileged, the value is silently treated as
if it were 0.

If the value of priority_change would result in a
system nice value outside the range 0 through 39,
the corresponding limit value of 0 or 39 is used
instead.

Note that a positive priority_change (lower
priority) has a single - option character before
the numeric value; a negative (higher priority)
priority_change has two: the option character
followed by the minus sign (--). If -
priority_change is not specified, it defaults to
10.
Ravi S. Banda
Regular Advisor

Re: How to increase the priority of a process (higher priority)

Yes, I'm logged in as root when running renice.
And also, when I a ps -elf, it shows the right NICE value but the PRI value remains the same as it was before. How to increase the PRI?

Thanks!
Ravi.
OldSchool
Honored Contributor

Re: How to increase the priority of a process (higher priority)

I believe you can only change the "nice" value. the scheduler does the rest, i.e. you have no direct control of the priority.
IT_2007
Honored Contributor

Re: How to increase the priority of a process (higher priority)

Don't get confused the relation between nice value and priority value. If you want to have higher priority then you need to assign lower value for nice.

From man page for nice:

......

A negative value requires superuser privileges,
and assigns a lower system nice value (higher
priority) to command. If the current process is
not privileged, the value is silently treated as
if it were 0.
Ravi S. Banda
Regular Advisor

Re: How to increase the priority of a process (higher priority)

I'm looking at rtprio which can change the real-time priority of currently executing process pid. rtprio 40 -24217.

How is this different from renice command? What is a real-time priority and how is it any different from a non real-time priority?
Bill Hassell
Honored Contributor

Re: How to increase the priority of a process (higher priority)

Note that changing the priority of a complex process (one that is not just comuting but does I/O too) will not always make it run faster. Scheduling in HP-UX is complex and is constantly adjusted with a number of different rules depending on what the program is doing during some fraction of a second. If the program that needs a higher priority (I am assuming you want it to run faster) is performing I/O, nothing special will be done to stop I/O from other programs. So if the data is shared on the same interface and disk, your high priority program will be competing with all other processes. Even a realtime priority (don't do that) will only ensure that instructions are run before any other process, but I/O depends on the hardware and is usually takes 100-1000 times longer than the actual instructions.

The PRM and WLM product will be useful as it manages all the resources, not just CPU time.


Bill Hassell, sysadmin