1751778 Members
4550 Online
108781 Solutions
New Discussion юеВ

system resource

 
addendum
Advisor

system resource

I found that in my system , there is a strange process that its process name is "osw" , if this process is running in the system , the system will become very slow ( because it will use much CPU time ), so I want to control this kind of process ( eg. if the process command is "osw" ) can only use maximum of a certain of CPU resource ( eg. 10 % ) , is it possible ? thx
4 REPLIES 4
Muthukumar_5
Honored Contributor

Re: system resource

You can change the cpu prioirty with nice utility so that it can not run by using more resource. check nice man page.

hth.
Easy to suggest when don't know about the problem!
addendum
Advisor

Re: system resource

thx reply ,

if not only want to set the prioirty , I want to control the cpu usage by process name , is it possible ? thx
Claudio Cilloni
Honored Contributor

Re: system resource

no, it isn't possible set maximum cpu usage. setting the lowest priority ensures that process uses very low cpu when other processes need it. But it will get 100% cpu when there aren't other processes running.

# renice 19

or

# renice 19 $(pgrep osw)


Ciao!
Claudio
Ivan Ferreira
Honored Contributor

Re: system resource

I think that nice or renice will do the job, anyway, there is a kernel patch, but I think that is not updated:

http://www.tls-technologies.com/CPU/cpu-main.html
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?