2019-06-02 14:27:24 +01:00
|
|
|
# cpulimit
|
|
|
|
|
|
|
|
> A tool to throttle the CPU usage of other processes.
|
2025-06-28 12:46:55 +03:00
|
|
|
> More information: <https://manned.org/cpulimit>.
|
2019-06-02 14:27:24 +01:00
|
|
|
|
|
|
|
- Limit an existing process with PID 1234 to only use 25% of the CPU:
|
|
|
|
|
2025-06-28 12:46:55 +03:00
|
|
|
`cpulimit {{[-p|--pid]}} {{1234}} {{[-l|--limit]}} {{25%}}`
|
2019-06-02 14:27:24 +01:00
|
|
|
|
|
|
|
- Limit an existing program by its executable name:
|
|
|
|
|
2025-06-28 12:46:55 +03:00
|
|
|
`cpulimit {{[-e|--exe]}} {{program}} {{[-l|--limit]}} {{25}}`
|
2019-06-02 14:27:24 +01:00
|
|
|
|
|
|
|
- Launch a given program and limit it to only use 50% of the CPU:
|
|
|
|
|
2025-06-28 12:46:55 +03:00
|
|
|
`cpulimit {{[-l|--limit]}} {{50}} -- {{program argument1 argument2 ...}}`
|
2019-06-02 14:27:24 +01:00
|
|
|
|
|
|
|
- Launch a program, limit its CPU usage to 50% and run cpulimit in the background:
|
|
|
|
|
2025-06-28 12:46:55 +03:00
|
|
|
`cpulimit {{[-l|--limit]}} {{50}} {{[-b|--background]}} -- {{program}}`
|
2019-06-02 14:27:24 +01:00
|
|
|
|
|
|
|
- Kill its process if the program's CPU usage goes over 50%:
|
|
|
|
|
2025-06-28 12:46:55 +03:00
|
|
|
`cpulimit {{[-l|--limit]}} 50 {{[-k|--kill]}} -- {{program}}`
|
2019-06-02 14:27:24 +01:00
|
|
|
|
|
|
|
- Throttle both it and its child processes so that none go about 25% CPU:
|
|
|
|
|
2025-06-28 12:46:55 +03:00
|
|
|
`cpulimit {{[-l|--limit]}} {{25}} {{[-m|--monitor-forks]}} -- {{program}}`
|