Interview Prep/Docker/Resource Limits, Health & Reliability

What is the impact of swap on containers?

AdvancedProductionResource Limits, Health & Reliability
Answer

With --memory=512m and default --memory-swap, a container may use up to 2x in swap on hosts with swap enabled, causing latency-killing swapping instead of a clean OOM. Set --memory-swap equal to --memory for deterministic behavior; most orchestrators disable swap on nodes. Requires cgroup swap accounting enabled.

All Docker questions Roadmap: Docker & containers

More on Resource Limits, Health & Reliability