Skip to content

[pull] main from livekit:main#323

Merged
pull[bot] merged 1 commit into
erickirt:mainfrom
livekit:main
Apr 16, 2026
Merged

[pull] main from livekit:main#323
pull[bot] merged 1 commit into
erickirt:mainfrom
livekit:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 16, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* Support CPU request override for containerized deployments

Media processing pods intentionally omit CPU limits to avoid CFS throttling on real-time media workloads. Without a limit, NumCPU() falls back to runtime.NumCPU() which returns the full node CPU count. This could inflate the admission budget — on a 64-core node with a 15-CPU request, the monitor thinks it has 64 CPUs available and accepts too many jobs. Goruntime GOMAXPROC env variable will also be set to too high value which could affect go runtime goroutine scheduling (frequent context switches).

CPU requests are a scheduler-level concept with no cgroup representation, so cgroup-based approaches (automaxprocs, Go 1.25 container awareness) can't help. The Kubernetes Downward API can expose requests.cpu as an env var, which this change reads.

EffectiveCPURequest() in cpu.go reads the env var once at startup and NumCPU() returns it when set, falling back to platform detection otherwise — monitorProcesses picks this up automatically. A new maxprocs package caps GOMAXPROCS down to ceil(request) via init(), never increasing it beyond the current value so explicit settings and cgroup quotas are respected.
@pull pull Bot locked and limited conversation to collaborators Apr 16, 2026
@pull pull Bot added the ⤵️ pull label Apr 16, 2026
@pull pull Bot merged commit ef071ca into erickirt:main Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant