Go 1.25 Fixes Container CPU Misconfiguration That Caused Kubernetes Throttling
Go services deployed on Kubernetes have long suffered from a runtime flaw where GOMAXPROCS defaulted to the host machine's full CPU count rather than the container's allocated limit, causing severe thread throttling and latency spikes. On a 64-core node with a 2-CPU pod limit, the Go runtime would spawn up to 64 OS threads competing for only 2 CPUs worth of time, sometimes pushing p99 latencies from 10ms into the hundreds of milliseconds. Go 1.25, released in 2025, addresses this by making GOMAXPROCS automatically read the cgroup CPU bandwidth limit at startup on Linux and rounding fractional quotas up to the nearest integer. The update also introduces dynamic re-evaluation, allowing the runtime to pick up live CPU limit changes from tools like Kubernetes VPA without requiring a pod restart. However, the memory-side problem — where Go's garbage collector remains unaware of cgroup memory limits and can trigger OOM kills — is not yet resolved natively in Go 1.25.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in