Repository navigation
Size RTC num_workers from the container's CPU and memory limits - #228
Open
chris-thomas-ga wants to merge 3 commits into
Open
chris-thomas-ga wants to merge 3 commits into
chris-thomas-ga wants to merge 3 commits into
Conversation
num_workers: 0 made RTC fall back to os.cpu_count(), which is the host core count inside a container. RTC forces each child burst process to memory_mode single_block, so a small pod on a large node could start far more burst processes than its memory limit allows and be OOM-killed. Add --num-workers (default "auto", env RTC_NUM_WORKERS) and --rtc-memory-per-burst-gib (default 8, env RTC_MEMORY_PER_BURST_GIB). "auto" uses min(cgroup CPU limit, cgroup memory limit / memory per burst), reading cgroup v2 or v1 and falling back to host values, with a minimum of 1. The value is written to runconfig.groups.processing.num_workers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e parent process --num-workers 0 (or RTC_NUM_WORKERS=0) now writes 0 to the run config so RTC picks the number of workers itself, the behaviour before this change. auto now subtracts --rtc-memory-reserve-gib (default 2) from the memory limit before dividing by the per-burst memory, leaving room for the parent rtc_s1.py process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
With
num_workers: 0, RTC falls back toos.cpu_count(), which inside a container is the host's core count. A small pod on a big node can end up starting a process per burst (up to ~27), and since RTC forces each child intosingle_blockmemory mode the pod gets OOM-killed after the download.This adds
--num-workers(defaultauto, also settable withRTC_NUM_WORKERS).autoreads the container's cgroup CPU and memory limits (v2, falling back to v1) and uses the smaller of the CPU count and(memory - reserve) / per-burst memory. The value is written to the run config, and the run script passes the options through.--rtc-memory-per-burst-gib(default 8) is the expected peak for one burst process.--rtc-memory-reserve-gib(default 2) is kept back for the parentrtc_s1.pyprocess before dividing the rest.--num-workers 0keeps the old behaviour (RTC picks the number itself). So this can be deployed withRTC_NUM_WORKERS=0first, with no change at all, and switched toautoonce we've watched a few jobs.The 8 GiB default is based on the peak we've seen for a single burst, so it may need tuning.
Testing
tests/sar_pipeline/test_resources.pyuses fake cgroup files, and also checks the value ends up in a saved run config.Type of change