Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port to CGroups #21

Open
adrelanos opened this issue Jan 4, 2021 · 1 comment
Open

port to CGroups #21

adrelanos opened this issue Jan 4, 2021 · 1 comment

Comments

@adrelanos
Copy link

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?

@adrelanos
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant