Pods are being OOMKilled but the memory graph never reaches the limit. Why?
IntermediateScenarioGrafana, Dashboards and Kubernetes Monitoring
Answer
Situation read → Scrape intervals miss short spikes, or the wrong memory metric is graphed.
What I'd do →
- Graph
container_memory_working_set_bytes(what the kubelet and OOM decisions relate to), notcontainer_memory_usage_byteswhich includes cache. - Confirm kills:
kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}andincrease(kube_pod_container_status_restarts_total[1h]). - Remember a 30s scrape cannot see a 2-second spike; check
container_oom_events_total(cAdvisor). - Profile the app (heap dumps, JVM
-XX:MaxRAMPercentage) and set limits based on peak, not average.
Why → OOM kills happen in milliseconds; averages and sparse scrapes hide them.
Interview tip → Know working_set vs usage vs rss; it comes up often.
More on Grafana, Dashboards and Kubernetes Monitoring
Grafana has 900 dashboards and nobody can find anything. How do you clean it up?IntermediateHow do you manage Grafana dashboards as code?IntermediateDesign a service overview dashboard that an on-call engineer can read in 10 seconds.BeginnerYou need to show deploy events on every Grafana graph. How?BeginnerHow do you detect CPU throttling hurting latency in Kubernetes?IntermediateYou inherit a cluster with no monitoring. What do you install first?Beginner