Q: How do you set resource limits for a Docker Compose service?
Under deploy.resources.limits: cpus: '0.5' and memory: 512M. Note: deploy key is only respected by Swarm mode; for regular Compose use me...
#Docker #Docker #L2 #Containers #Linux
🎙️ Candidate Opening & Architectural Context
""In an interview, I explain how we diagnosed container runtime failures without guessing. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Production Solution & Architecture
Under deploy.resources.limits: cpus: '0.5' and memory: 512M. Note: deploy key is only respected by Swarm mode; for regular Compose use mem_limit and cpus at the service level.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Under deploy.resources.limits: cpus: '0.5' and memory: 512M. Note: deploy key is only respected by Swarm mode; for regular Compose."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: Under deploy.resources.limits: cpus: '0.5' and memory: 512M. Note: deploy key is only respected
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement