[GH-ISSUE #4354] cpulimit limits #2629

Open
opened 2026-05-05 09:17:32 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @rusty-snake on GitHub (Jun 10, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4354

Currently we have --cpu to limit cores and --rlimit-cpu to limit the total time.

Cpulimit is a tool which limits the CPU usage of a process (expressed in percentage, not in CPU time).

IMO this would be a good addition.

The project seems to be dead (last commit 17 Jun 2015) but it is packaged in the most distros as I see it.
IDC if you call cpulimit (which need it installed), integrated it's code (GPLv2+ too) or implement your own code.

Originally created by @rusty-snake on GitHub (Jun 10, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/4354 Currently we have `--cpu` to limit cores and `--rlimit-cpu` to limit the total time. > [Cpulimit](https://github.com/opsengine/cpulimit) is a tool which limits the CPU usage of a process (expressed in percentage, not in CPU time). IMO this would be a good addition. The project seems to be dead (last commit 17 Jun 2015) but it is packaged in the most distros as I see it. IDC if you call `cpulimit` (which need it installed), integrated it's code (GPLv2+ too) or implement your own code.
gitea-mirror added the
enhancement
label 2026-05-05 09:17:32 -06:00
Author
Owner

@reinerh commented on GitHub (Jun 10, 2021):

This is also possible with cgroups:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/resource_management_guide/sect-cpu-example_usage
Which is a bit nicer than cpulimit, as the cgroup limits will be enforced by the kernel.
From a quick glance cpulimit is sending SIGSTOP/SIGCONT to processes to enforce the limit (which seems a bit inaccurate to me).

<!-- gh-comment-id:858851484 --> @reinerh commented on GitHub (Jun 10, 2021): This is also possible with cgroups: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/resource_management_guide/sect-cpu-example_usage Which is a bit nicer than cpulimit, as the cgroup limits will be enforced by the kernel. From a quick glance cpulimit is sending `SIGSTOP`/`SIGCONT` to processes to enforce the limit (which seems a bit inaccurate to me).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2629
No description provided.