A container uses only 40% of its CPU limit on average, yet latency is high; `container_cpu_cfs_throttled_periods_total` keeps rising.

AdvancedTroubleshootingLatency
Answer

Likely causes → CFS quota throttling: the limit is enforced per 100 ms period, so bursty, multi-threaded work hits the quota early in the period and stalls for the rest of it. Averages hide this. Runtimes that size thread pools from host cores make it worse.

Diagnose →

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

More than 5–10% throttled periods on a latency-sensitive service is a problem.

Fix → Raise or remove the CPU limit (keep requests accurate), and set runtime thread counts to match (GOMAXPROCS via automaxprocs, -XX:ActiveProcessorCount).

Prevent → Dashboard throttling ratio per workload and review CPU limits for latency-critical services.

All Real-World Interview questions Roadmap: Interview readiness

More on Latency