Monday, August 27, 2012

Installing and compiling LimitCPU

LimitCPU is a program to throttle the CPU cycles used by other applications. LimitCPU will monitor a process and make sure its CPU usage stays at or below a given percentage......

Compiling and Installing is not difficult. Do look at the README
# cd cpulimit-1.7
# make
# make install

To remove the installation, do
# make deinstall

Common Usage
With Reference to LimitCPU README

1. For  example, if you wish to cap the cpu usage to 50% for processor 12345
# cpulimit -p 12345 -l 50

2. If you wish to run LimitCPU in the background
# cpulimit -p 12345 -l 50 -b

3. If you wish to limit running processes based on their name instead of their process ID. The below example will keep an eye on "bigexe" and, if the application quits and another program called "bigexe" is run, LimitCPU will monitor the new process too. Pretty cool eh
# cpulimit --exe /usr/bin/bigexe --limit 50

4. If you wish to only track the first program and then exit
# cpulimit --exec /usr/bin/bigexe --limit 50 -z

No comments: