A common deployment mistake is assuming that Go derives GOMAXPROCS from a container’s CPU limit. It does not: on an eight-core node, a container limited to 4,000 millicpu can still start with GOMAXPROCS set to eight. Kubernetes enforces the limit separately through the Completely Fair Scheduler (CFS), so concurrent execution can consume the quota quickly and trigger throttling. section 12.10
A four-core limit on an eight-core node
With a 100 ms CFS period and a four-core limit, the quota is 400 ms of CPU time per period. Four busy threads can consume all 400 ms during that period; CFS then throttles the application instead of allowing continued execution. The observable result is reduced CPU progress even though the host has additional cores. section 12.10
spec:
containers:
- name: myapp
image: myapp
resources:
limits:
cpu: 4000m
Use the Kubernetes resource declaration to relate a 4,000-millicpu limit to the CFS quota enforced at runtime. section 12.10
Reduce or diagnose the problem by:
- Treating the container CPU limit and GOMAXPROCS as separate settings rather than assuming Go is CFS-aware. section 12.11
- Bounding concurrent work when the goal is resource utilization control; a channel used for rate limiting should have a capacity tied to the limit, not an unexplained magic number. section 9.7













