An application has a memory leak and gets slower until restarted weekly. While devs fix it, how do you reduce impact?
BeginnerScenarioMigrations, performance and fleet operations
Answer
Situation read → Contain the leak and restart in a controlled way.
What I'd do →
- Cap memory with
MemoryMax=andRestart=on-failureso it restarts cleanly instead of pushing the host into swap. - Schedule a rolling restart across instances during low traffic (systemd timer running
systemctl restart app, one host at a time). - Graph RSS over time (
ps -o rss= -p PIDinto metrics) to give devs data.
Why → Controlled restarts beat random OOM kills of other processes.
Interview tip → Be clear it's a mitigation, not a fix; give devs heap dumps.
More on Migrations, performance and fleet operations
You must migrate 2 TB of application data from an old server to a new one with less than 5 minutes of downtime. How?IntermediateThe new server has different UIDs for the same users than the old one. What breaks during migration and how do you handle it?IntermediateA server is "slow" according to users. What is your first 60 seconds of investigation?BeginnerYour team must capacity-plan for a server whose disk grows 4% per week. How do you predict when it fills?IntermediateYou need to replace a physical server with a VM without changing its IP or hostname. Plan the cutover.IntermediateMemory usage on a server shows 95% used but the app is fine. A manager is worried. How do you explain and verify?Beginner