Dev Tools · 1h ago
Fix Go App Throttling on Kubernetes with automaxprocs
Go apps in Kubernetes can suffer latency spikes because GOMAXPROCS defaults to the node's CPU count, not the container limit. This causes the Linux CFS scheduler to throttle the app when it spawns too many threads. Uber's automaxprocs library fixes this by reading cgroup limits and setting GOMAXPROCS correctly.
Meridian48 take
A simple one-line import solves a performance pitfall that many Go-on-K8s teams hit, but the real fix—Go 1.25's cgroup-aware runtime—can't come soon enough.
gokubernetes