• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

cpulimit Command Examples in Linux

by Deepika

The cpulimit command is a utility in Linux that is used to limit the CPU usage of a process. This can be useful if you want to ensure that a process does not consume too much CPU time, or if you want to limit the impact of a CPU-intensive process on the overall performance of the system.

Here is an example of using the cpulimit command:

# cpulimit -p PID -l LIMIT

This will limit the CPU usage of the process with the specified PID to the specified limit (expressed as a percentage of the CPU’s total capacity). For example, if you specify a limit of 50%, the process will not be allowed to consume more than 50% of the CPU’s time.

It is important to note that limiting the CPU usage of a process may affect its performance and may cause it to take longer to complete its tasks. Therefore, it is recommended to use the cpulimit command with caution and only when necessary.

cpulimit Command Examples

1. Limit an existing process with PID 1234 to only use 25% of the CPU:

# cpulimit --pid 1234 --limit 25%

2. Limit an existing program by its executable name:

# cpulimit --exe program --limit 25

3. Launch a given program and limit it to only use 50% of the CPU:

# cpulimit --limit 50 -- program arg1 arg2 ...

4. Launch a program, limit its CPU usage to 50% and run cpulimit in the background:

# cpulimit --limit 50 --background -- program

5. Kill its process if the program’s CPU usage goes over 50%:

# cpulimit --limit 50 --kill -- program

6. Throttle both it and its child processes so that none go about 25% CPU:

# cpulimit --limit 25 --monitor-forks -- program

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to delete LVM volume
  2. pacman-mirrors Command Examples in Linux
  3. fg: Run jobs in foreground
  4. How to Install gnome-session-wayland software package in Ubuntu
  5. acpi Command Examples in Linux
  6. wg Command Examples in Linux
  7. qtchooser: command not found
  8. git flow: A collection of Git extensions to provide high-level repository operations
  9. RedHat / CentOS : How to change currently active slave interface of bonding online
  10. gifdiff: Compare two GIFs for identical visual appearance

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright