LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fixed maximum CPU usage for a process... (https://www.linuxquestions.org/questions/linux-newbie-8/fixed-maximum-cpu-usage-for-a-process-785973/)

chamila1986 01-31-2010 06:58 AM

Fixed maximum CPU usage for a process...
 
Are there a way to set fixed maximum processing power to a process...

For example a program called 'X' uses cpu in high speed. I need to set this 'X' process to to run with maximum 20% of cpu usage at any time.

kdelover 01-31-2010 07:05 AM

there is a tool called cpulimit

http://cpulimit.sourceforge.net/

chamila1986 01-31-2010 08:20 AM

I tried out 'cpulimit' sir as you advised. But when there are several instances of same program running it only considers one instance of process of given name. Is there a way to avoid this without using pid and only using process name???

eg: cpulimit -P MyProcess -l 20

This sets cpu max usage for 'MyProcess' upto 20% but when I launch a new instance of 'MyProcess' the cpulimit is not effect for that. I need to set MAX cpulimit 20% all processes called MyProcess whenever it launches or whatever instances it runs...

worm5252 01-31-2010 09:15 AM

Is this "Process" an installed package or a script? If it is a script, what language?

chamila1986 01-31-2010 11:22 PM

Sir 'worm5252', The 'Process' is my program which is written in C and I need to execute multiple instances of that process ensuring that the process consumes upto maximum 20% processing power. I need to do it externally....not by modifying source code of the program.


All times are GMT -5. The time now is 06:31 AM.