Forrest logo
back to the cpulimit tool


cpulimit: Limit an existing process with PID 1234 to only use 25% of the CPU.
$ cpulimit --pid ${1234} --limit ${25%}
try on your machine

This command is used to limit the CPU usage of a specific process with a given process ID (PID). Here's a breakdown of the command:

  • cpulimit: This is the main command that sets the CPU usage limit for a process.
  • --pid ${1234}: It specifies the process ID (PID) of the process for which you want to limit the CPU usage. In this example, ${1234} is a placeholder, and you should replace it with the actual PID of the process you wish to target.
  • --limit ${25%}: This flag specifies the CPU usage limit as a percentage. The ${25%} is another placeholder to be replaced. You should specify the desired CPU usage limit in percentage by replacing ${25%}. For example, if you want to limit the CPU usage to 25%, you would replace ${25%} with 25.
This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cpulimit tool