apt-get install cpulimit
yum install cpulimit <enable epel>
#Eg. . on centos 6.5 with cpulimit-0.1-1.20140722gitcabeb99.el6.x86_64.rpm
cpulimit -p 8645 -l 10
#limits this process to 10 % of cpu
cpulimit -e /usr/local/bin/myprog -l 20
#limits the CPU usage of /usr/local/bin/myprog to 20%
X% of one CPU. So for example, if you set "-l 100" on a dual-core machine, you are limiting the usage to 50% of available CPU resource.
To find out PID of the process use any of the following:
yum install cpulimit <enable epel>
#Eg. . on centos 6.5 with cpulimit-0.1-1.20140722gitcabeb99.el6.x86_64.rpm
cpulimit -p 8645 -l 10
#limits this process to 10 % of cpu
cpulimit -e /usr/local/bin/myprog -l 20
#limits the CPU usage of /usr/local/bin/myprog to 20%
X% of one CPU. So for example, if you set "-l 100" on a dual-core machine, you are limiting the usage to 50% of available CPU resource.
To find out PID of the process use any of the following:
# ps aux | less
# ps aux | grep firefox
# pgrep -u vivek php-cgi
# pgrep lighttpd
No comments:
Post a Comment