Skip to content

[perf] Respect cgroup/CFS CPU quota in parallel worker count - #8559

Merged
TomasVotruba merged 1 commit into
mainfrom
cpu-count-cgroup-aware
Oct 9, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
cpu-count-cgroup-aware

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

CpuCoreCountProvider used fidry getCount(), which reports host logical cores and ignores cgroup/CFS CPU quota. In containers (docker run --cpus=N, KUBERNETES_CPU_LIMIT) this overcommits workers against the quota the scheduler actually enforces.

Switched to getAvailableForParallelisation()->availableCpus, whose default count-limit finder already reads the cgroup quota and KUBERNETES_CPU_LIMIT. On a host with no quota the value is unchanged.

The previous NumberOfCpuCoreNotFound catch is dropped because getAvailableForParallelisation() falls back internally and does not throw it.

@TomasVotruba
TomasVotruba merged commit 6f1a0d5 into main Oct 9, 2026
50 checks passed
@TomasVotruba
TomasVotruba deleted the cpu-count-cgroup-aware branch October 9, 2026 07:47
@TomasVotruba TomasVotruba changed the title Respect cgroup/CFS CPU quota in parallel worker count [perf] Respect cgroup/CFS CPU quota in parallel worker count Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant