Interview Prep/SRE & Reliability/Reliability Patterns in Production

p99 latency spikes every few seconds although CPU usage averages only 40% of the limit.

IntermediateTroubleshootingReliability Patterns in Production
Answer

Likely causes → CFS throttling: the container bursts above its CPU limit within a 100 ms period and is paused for the rest of the period. Averages hide it, especially for multi-threaded runtimes (JVM, Go with high GOMAXPROCS).

Diagnose →

rate(container_cpu_cfs_throttled_periods_total{namespace="shop",container="checkout"}[5m])
/ rate(container_cpu_cfs_periods_total{namespace="shop",container="checkout"}[5m])

Fix → Raise or remove CPU limits (keep requests), set GOMAXPROCS to match the limit (automaxprocs) or JVM -XX:ActiveProcessorCount, and re-test.

Prevent → Alert on throttling ratio above 25% for latency-sensitive services.

All SRE & Reliability questions

More on Reliability Patterns in Production