Repository navigation
fix(rust): size the build slice from host RAM - #129
Merged
Merged
Conversation
rustbuild.slice allowed 70% of RAM before killing a build. That was 21 GB on a 30 GB host. One 16 GB clippy run took down the host, VS Code and every session. The developer-rust role works out the limits from ansible_facts memtotal_mb at converge: - rustbuild.slice: MemoryMax 33% and MemoryHigh 27%, floors 4 GiB and 3 GiB. A build-dedicated host raises rust_governor_memory_max_pct and rust_governor_memory_high_pct in its own vars. - Add agents.slice, the cgroup hyperi-ai attaches each Claude Code session to. MemoryMax is RAM minus a desktop reserve (the larger of 30% and 9 GiB) minus the rust MemoryMax. The three budgets add up to RAM. MemoryHigh is 90% of that. CPUWeight is 25. TasksMax is 1024 per vCPU. - Off by default: a systemd-oomd drop-in on agents.slice (agents_oomd_enabled). - Also off by default: a user@.service drop-in delegating cpuset and io (agents_delegate_enabled, system scope, applies at next login). The shim's nice 19 and the slice CPUWeight are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rustbuild.slice allowed 70% of RAM before killing a build. On a 30 GB host that was 21 GB, and one 16 GB clippy run took the whole machine down.
The developer-rust role sets memory limits from host RAM at converge. It also adds agents.slice for Claude Code sessions, which hyperi-ai attaches at SessionStart.
Defaults, all role vars a host can override:
Template values (ansible --check --diff):
30 GB host (memtotal 31149 MB, 12 vCPU):
92 GB host (94208 MB, 32 vCPU):
tools/ci/run-tests.sh passes (syntax check, shellcheck, 106 pytest, matrix and file-reference gates). ansible-lint reports nothing in the changed files. Host execution is untested.
This repo holds no inventory for desktop-derek, so a bigger build share for it goes in that host's vars, e.g. rust_governor_memory_max_pct: 60.