the solution:limit users' cpu usage

wanren

Verified User
Joined
Mar 1, 2010
Messages
29
Hi all, I finally got a solution to limit users' cpu usage and I post thread here to thank for all of your previous warm help:)

Official website:http://cpulimit.sourceforge.net/

1. cd /root/install/
2. svn checkout https://cpulimit.svn.sourceforge.net/svnroot/cpulimit/trunk cpulimit
3. cd cpulimit
4. make
5. cp ./cpulimit /usr/sbin

Examples of use
Limit the process 'bigloop' by executable name to 40% CPU:
cpulimit --exe bigloop --limit 40
cpulimit --exe /usr/local/bin/bigloop --limit 40

Limit a process by PID to 55% CPU:
cpulimit --pid 2960 --limit 55

Launch a process by command line and limit it to 40% (in development version only!):
cpulimit --limit 40 /etc/rc.d/rc.boinc start

Perfect solution:
automatically limit the process which is causing 20% cpu to 10%
cpulimit --pid `ps aux|awk '{if($3 > 20) print $2}'` --limit 10

I hope this could be helpful to you and appreciate if there is any suggestion.
 
Hello,

It limits CPU of a process only:

pulimit is a simple program which attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don't want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.


http://cpulimit.sourceforge.net/
 
Back
Top