Installing CPULimit
Install using source code
# cd/tmp
# wget ' http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz '
# tar cpulimit-1.1.tar.gz# CD cpulimit-1.1
# make
# CP cpulimit/usr/local/sbin/
# RM-RF CPULimit
*debian/ubuntu Users
More convenient installation with Apt-get
$ sudo apt-get update
$ sudo apt-get install CPULimit
How do I use CPULimit?
Restrict Firefox to use 30% CPU utilization
# CPULIMIT-E Firefox-l 30 Limit process number 1313 for programs using 30% CPU utilization
# cpulimit-p 1313-l 30 Find the PID method according to the process name
# PS aux | Less
# PS aux | grep Firefox
# pgrep-u Vivek PHP-CGI
# Pgrep LIGHTTPD can limit CPU utilization of processes using absolute paths
# cpulimit-p/opt/firefox/firebox-l 30 single-core CPUs and multi-core CPUs
The single-core CPU uses a range of 0%-100%, and the quad-core CPU uses a range of 0%-400%.
Related tools
Nice: Run the program at the specified priority level
Renice: Adjust the priority of the process to run
Linux limits process CPU usage under Ubuntu