Operating System - Linux
1752393 Members
7072 Online
108788 Solutions
New Discussion юеВ

Re: Control the resource usage

 
SOLVED
Go to solution
ust3
Regular Advisor

Control the resource usage

I have some process that is running in the system , I would like to control the priority to run these process , I tried to renice it , I found that even use -19 or +19 , the priority is the same .
Could you please advise me if I want to lower the priority ( or reduce the system resource usage to the process ), what should I do ? after change the priority , what should be the figure of NI and PRI value ? thx in advance.
6 REPLIES 6
TY 007
Honored Contributor
Solution

Re: Control the resource usage

Hello,

Influence scheduling priority with nice and renice:
http://www.linux.com/articles/58638

Thanks
Ivan Ferreira
Honored Contributor

Re: Control the resource usage

The NICE value is just one of several factors used to define the priority of a process.

You could try cpulimit.

http://cpulimit.sourceforge.net/
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
ust3
Regular Advisor

Re: Control the resource usage

thx replies,

I have tried cpulimit , but it seems have problem , could advise what is wrong ?

cpulimit --pid 17285 --limit 50
Segmentation fault

where 17285 is ppid

ust3
Regular Advisor

Re: Control the resource usage

thx replies,

I tried renice many times , I use renice -19 pid or renice +19 pid , when I use top to find this process , this process is stlll on the top CPU usage (99%) , I wonder why NI is 19 or -19 , its CPU usage is still 99% , could advise what is wrong ? thx
Hein van den Heuvel
Honored Contributor

Re: Control the resource usage

>> I found that even use -19 or +19 , the priority is the same .

1) You need to be super-user to use negative nice values.

2) What tool do you use to show the priority? (top? ps?)

3) nice (or nasty) is all about priority relative to the competition. You might pick +5, but if all other processes are nicer (+10?) or autoniced, then your are still the mean kid on the block.
Specifically, if the target process is the only runnable process most of the time, then it can easily, legitimately, still get 99% of the cpu, because no other process wants it more. This would quickly SEEM the case if the competition is for example a 'vi' session which only needs the cpu for a very short time.

4) you may have stumbled into a problem. Which Linux? Which version? Which platform?


Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting


ust3
Regular Advisor

Re: Control the resource usage

thx reply ,

I use RHEL 3 , I use "top" to show priority , I already use root user to renice the process.

I strange that even the NI value is -19 or 19 , the CPU usage is also 99% , can advise what is wrong ? thx