Interview Prep/Kubernetes/Resources, OOM, probes and termination

p99 latency spikes every few seconds, CPU usage graph shows only 40% of the limit.

AdvancedTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → CFS throttling. The CPU limit is enforced per 100 ms period. A multi-threaded app can burn its whole quota in 20 ms and then be paused for 80 ms, even though the average is low.

Diagnose →

rate(container_cpu_cfs_throttled_periods_total{pod=~"api-.*"}[5m])
  / rate(container_cpu_cfs_periods_total{pod=~"api-.*"}[5m])

Over 10–20% throttled periods on a latency-sensitive service is a problem.

Fix → Raise or remove the CPU limit (keep an accurate CPU request for scheduling and fair share). Make runtimes respect the quota: Go GOMAXPROCS via automaxprocs, JVM -XX:ActiveProcessorCount.

Prevent → Alert on throttling ratio; many teams run latency-critical services without CPU limits and rely on requests.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination