Operating System - HP-UX
1834149 Members
2329 Online
110064 Solutions
New Discussion

Re: change the priority of the process

 
ivychung2
Frequent Advisor

change the priority of the process

I want to lower the priority of the process to be run , I tried to use "renice -19 pid" then found that the new priority as below , it still is the most top priority process in the system , could suggest how to make it to be the lowest one ? thx.


# top

PRI NI
9 -19
11 REPLIES 11
Torsten.
Acclaimed Contributor

Re: change the priority of the process

What process we are talking about?

BTW, have a look at "man nice".
In fact, you are *increasing" the priority.
(low value = high prio).

You should know exactly what you are going to do, otherwise you can get into trouble.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
ivychung2
Frequent Advisor

Re: change the priority of the process

thx reply ,

I have reset the priority , and use the command "renice +19 pid" , now when use top to check the status, the result is as below, both value of PRI and NI are 19 and still the top priority in my system , what I want is just want to lower the priority of it , could suggest what can I do ? thx

PRI NI
19 19
Ninad_1
Honored Contributor

Re: change the priority of the process

Hi,

You have used the command already
renice -n newoffset pid
[ You will be decreasing the priority. If you give negative value to newoffset you will be increasing the priority]
Note : Be extra vigilant on which process you are trying to increase/decrease priority - if its a system process.
If its user process - it may well affect the performance of that process - unless that what you wish to do.

Regards,
Ninad
Ajitkumar Rane
Trusted Contributor

Re: change the priority of the process

for example renice -n 13 pid will cahange the priority of the process to 20+13=33.

so if you want the process to run at priority 39 user renice -n 19 pid


Rgds,

Ajit
Amidsts difficulties lie opportunities
ivychung2
Frequent Advisor

Re: change the priority of the process

thx reply,

As you said , I use negative value with renice command , but now the PRI and NI value is 19 and is the top priority process ,
I check with top command , it is the first process , so I feel it is very strange , could suggest what is wrong ? thx.

Re: change the priority of the process

u can try this also

#renice --19 PID

this will solve your problem

anith
Ninad_1
Honored Contributor

Re: change the priority of the process

OK Lets get everything clarified first.
Please let us know if you wish to
1. Run the process with high priority (This process must get preference over others)
OR
2. Low priority (This process must get lesser preference)

e.g. Change nice value by 10
For 1. do renice -n -10 pid (This will give more preference/priority to the process)
For 2. do renice -n 10 pid (This will give lesser preference/priority to this process)

Hope this clarifies.
Regards,
Ninad
ivychung2
Frequent Advisor

Re: change the priority of the process

thx replies,

I want to ". Low priority (This process must get lesser preference)" , thx.
Ninad_1
Honored Contributor

Re: change the priority of the process

Hi,

As mentioned in my reply above, you should use
renice -n 19 pid [ Note it should be 19 and not -19]
This will tell the scheduler in the kernel to give this process lesser priority by a value of 19.
Now the scheduler manages to give the respective CPU times to processes according to their priority and other processes running on the system.
I think you are confused by the 2 fields Priority and Nice.
Nice will by default have a vaule of 20.
Now you can change Nice value from -20 to +20 depending on whether you want to give high priority or low priority respectively.
Now according to this Nice value and other processes running, the current priority vaule of the process is adjusted to give it the CPU time.

Hope this clarifies,
Ninad
ivychung2
Frequent Advisor

Re: change the priority of the process

thx all
Ninad_1
Honored Contributor

Re: change the priority of the process

Hi,

Would you like to appreciate time and suggestion people have given for your query. You can do that by assigning relevant points to the solutions.

Regards,
Ninad