DevOps Engineer interview question · Most asked
Pods keep restarting with OOMKilled under load. How do you investigate and fix it?
Summary
Confirm with kubectl describe (reason OOMKilled, exit code 137), compare memory working set with the limit, and check how the runtime sizes its heap. Usually the heap is fixed above the container limit or non-heap memory wasn't accounted for. Size the runtime relative to the limit (MaxRAMPercentage, --max-old-space-size, GOMEMLIMIT), set requests and limits from measured usage, and look for leaks in GC metrics.
Longer Answer
OOM kills are SIGKILLs from the kernel: no graceful shutdown and no runtime exception. Restarts under load cascade as the remaining pods take more traffic, so add capacity first during an incident. Alert on restart reasons, not just availability.
Key Points
- 137 = SIGKILL, usually the memory limit.
- Runtime heap vs container limit.
- Size from measurements.
- Alert on OOMKilled restarts.
Deep dive: DevOps in Production: Restart Loop at Peak Traffic
Explanation
What interviewers look for
A methodical investigation and container-aware runtime settings.
More most-asked DevOps Engineer questions
- Design a CI/CD pipeline for a containerised microservice from commit to production.
- Every deployment produces a burst of 502s. What do you check?
- How do you handle database schema migrations in an automated deployment pipeline?
- How do you handle secrets in CI/CD pipelines securely?
- What happens when you type a URL into a browser and press Enter?
- A rollback after a release made the outage worse because the database had already been migrated. How do you design releases so rollbacks are always safe?
- What are DORA metrics, and how would you use them without gaming them?
- Your CI pipeline takes 45 minutes. How would you speed it up?