Interview Prep/Docker/Limits, logging, health checks and restarts

Latency spikes though CPU usage looks low (50%).

AdvancedScenarioLimits, logging, health checks and restarts
Answer

Situation read → CFS throttling can occur in bursts even at modest averages.

What I'd do → Check cat /sys/fs/cgroup/cpu.stat inside the container (cgroup v2) for nr_throttled and throttled_usec. Raise or remove the CPU limit, use --cpu-shares/requests only, or tune the app's thread pools to match --cpus.

Why → A multi-threaded app can burn its 100 ms quota in 20 ms and then stall.

Interview tip → Many teams set requests but no CPU limits for this reason.

All Docker questions Roadmap: Docker & containers

More on Limits, logging, health checks and restarts