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.
More on Resources, OOM, probes and termination
`kubectl describe pod` shows `Last State: Terminated, Reason: OOMKilled, Exit Code: 137`.BeginnerA Java service is OOMKilled at 2 GiB limit but the heap is only `-Xmx1800m`.IntermediateMany Pods on one node were killed at once and the node shows a `SystemOOM` event. Container limits were not reached.AdvancedPods show `Evicted` with `The node was low on resource: memory. Threshold quantity: 100Mi, available: 87Mi. Container app was using 1.4Gi, request is 256Mi`.IntermediateA Pod is evicted with `Pod ephemeral local storage usage exceeds the total limit of containers 1Gi`.IntermediatePods restart every few minutes with `Liveness probe failed: Get "http://10.0.3.17:8080/healthz": context deadline exceeded (Client.Timeout exceeded while awaiting headers)`.Intermediate