-
Notifications
You must be signed in to change notification settings - Fork 12
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
Limit memory usage based on cgroup info #5260
Limit memory usage based on cgroup info #5260
Conversation
@goern @harshad16 you might be interested. |
1e7afe7
to
bc32b62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question/comment, but
/approve
the proposal, good idea, thanks
thoth/solver/cli.py
Outdated
memory = limit.read() | ||
if memory == "max": # memory.high might contain "max" -> indicates to use the memory.max value | ||
continue | ||
value = int(limit.read()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this meant to be:
value = int(limit.read()) | |
value = int(memory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, spot on, thanks 👍
bc32b62
to
0207c59
Compare
We try to convert OOM-kill at the cgroup level into python MemoryError. The method employed has a number of caveats: - setrlimit only acts on one process, when cgroup is a group of process ; other process in the container could also consume memory - the OOM-killer might still kick in before Python raising MemoryError, depending on the particular of the Python allocator
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: codificat, goern The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Related Issues and Dependencies
This should help diagnoses thoth-station/thoth-application#2690
We should get some stacktrace, which will help us locate where our python code allocates a lot. (Especially if we have a space complexity bug/problem)
This introduces a breaking change
Description
We try to convert OOM-kill at the cgroup level into python MemoryError.
The method employed has a number of caveats:
; other process in the container could also consume memory
depending on the particular of the Python allocator