GOMAXPROCS exceeds CPU limit

On-call incidentMedium30 min

Your task

A latency-sensitive Go service in Kubernetes shows periodic p99 latency spikes every ~100ms and elevated tail latency under load, yet the pod's reported CPU usage averages only ~40% of its limit and the node has spare capacity. The container has limits.cpu: 2 and requests.cpu: 0.5. GOMAXPROCS is left at the node's core count (32). The spikes got worse after the cluster moved to higher-core nodes. How do you triage and fix?

It covers

  • Cpu throttling
  • Cgroups
  • Kubernetes limits