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.
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.