Skip to the content.

cpulimit

Build Status GitHub version CodeQL

This CPULimit Project is not Original. it does patched a few features based on CPULimit Project (v1.1) in sf.org

cpulimit is written by Angelo Marletta. Thx Angelo, your project helped to my task

How to Work

List of Patches

Tested

Requirement

Compile

compile for generally

# make
Removing Garbage Files..
Complete
Normal compiling..
Complete

compile for generally

Static compiling..
Warnning..
Caution : Binary likely not working on Kernel 4.8.0-30-generic / Glibc 2.24 under version..
Complete

compile for debugging

Set Debug mode enviroment..
    kernel.core_pattern=/tmp/%e.core.%u
    kernel.suid_dumpable=1
    fs.suid_dumpable=1
    kernel.core_uses_pid=1
Complete
Debug compiling..
Complete

Support Parameters

Usage: cpulimit TARGET [OPTIONS...]
  TARGET must be exactly one of these:
      -p, --pid=N        pid of the process
      -e, --exe=FILE     name of the executable program file
      -P, --path=PATH    absolute path name of the executable program file
      -L, --logpath      logfile path
   OPTIONS
      -l, --limit=N      percentage of cpu allowed from 0 to 100 (mandatory)
      -v, --verbose      show control statistics
      -z, --lazy         exit if there is no suitable target process, or if it die
      -h, --help         display this help and exit
      -d, --daemonize    damonization
      -f, --fore         force run, killing prevent process with forcing muti run lock

Madantory Parameters

Optional Parameters

How to Use

## find target process id
# pgrep crond
1234

## run
# ./cpulimit -p 1234 -l 10 -L /tmp/cpulimit.crond.log -d
1234 is not working, please first check pid

## force running when kill -9 `cpulimit` or after system shutdown or reboot or other
# ./cpulimit -p 1234 -l 10 -L /tmp/cpulimit.crond.log -d
# ./cpulimit -p 1234 -l 10 -L /tmp/cpulimit.crond.log -d
Another CPULimit daemon working.. (PID:1825), please first check it(1)
# ./cpulimit -p 1234 -l 10 -L /tmp/cpulimit.crond.log -d -f

# pgrep cpulimit
1828

# looking cpulimit log
# tail /tmp/cpulimit.crond.log
[2013-12-03 15:07:08 KST] Starting TARGET:1234,ME:1828,LIMIT:10

Moved from bitbucket.org.

According to Original Project’s License.

See the this project based on CPULimit Project : http://cpulimit.sourceforge.net/