timeout
timeout copied to clipboard
port to CGroups
Since you mentioned in readme...
Note: CGroups
Linux now supports the CGroups feature, which is a much better method to track memory and time usage and not limited by the issues listed below. This
timeout
script does not use CGroups. While this script continues to work, if you are on Linux and need a more robust monitoring method you should use something based on CGroups. For system services, have a look at available systemd options. For a simple command-line script to limit memory usage you could for example use runexec, which is part of BenchExec.
Could you please this project to be using CGroups or perhaps start a new repository for that?
My for now failed attempt using CGroups
:
https://forums.whonix.org/t/constrained-system-resources-program-starter-wrapper/10914/4
- No relative limits such as "use maximum 80% of available CPU, RAM, IO" can be easily implemented. Hardcoded limits are not great.
- Difficult to limit IO since
<major>:<minor>
syntax is required to limit IO.
My for now failed attempt using systemd-run
:
https://github.com/Whonix/helper-scripts/blob/854bb44ead4f4fd6c273030f316d830f2c510f78/usr/bin/limit-low
- "More heavyweight" solution.
- Corner cases with missing environment variables. Would require the wrapper doing something slightly intrusive such as
systemctl --user import-environment
. - Worked for applications started as root but but not for applications started as user. Might require some bug reporting against systemd or elsewhere.