Skip to content

feat: support adjusting child proc oom scores #12655

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

Merged
merged 10 commits into from
Apr 3, 2024
Merged

feat: support adjusting child proc oom scores #12655

merged 10 commits into from
Apr 3, 2024

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Mar 19, 2024

  • Adds support for modifying child process oom_score_adj values. The logic for the child's score is:
    • If agent score < 0 then 0
    • If 0 <= agent score < 998 then 998
    • If agent score >= 998 then 1000
  • Reduces potential for log spam when we're not permitted to adjust a process's niceness or oom_score
  • Adds a CODER_PRO_OOM_SCORE for specifying an explicit value for child oom scores

It's still the responsibility of the template admin to run the agent with a customer oom score since it's awkward for us to set it ourselves (we need cap_sys_resource and it needs to be set on the binary since we can't elevate or own privileges if we're ever run as non-root)...if people want this we can eventually support it.

@deansheather I didn't go with the solution we talked about since I was encountering some inconsistencies when adding a coder agent exec command...I think it's due to needing to lock the OS thread we're running on but I had to do some jank to make it work so let's hold off until this solution isn't sufficient.

@sreya sreya changed the title fix: adjust process oom_score_adj to 0 feat: support adjusting child proc oom scores Mar 21, 2024
@sreya sreya requested a review from deansheather March 21, 2024 00:15
@sreya sreya marked this pull request as ready for review March 21, 2024 00:25
@github-actions github-actions bot added the stale This issue is like stale bread. label Mar 30, 2024
@sreya sreya removed the stale This issue is like stale bread. label Apr 2, 2024
@sreya sreya requested a review from deansheather April 2, 2024 22:52
@sreya sreya merged commit 426e9f2 into main Apr 3, 2024
@sreya sreya deleted the jon/procprio branch April 3, 2024 14:42
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

Successfully merging this pull request may close these issues.

2 participants