← Back to all fixes

Deployment causes downtime — requests drop during rollout

The Issue

Users see errors or connection resets for 10-20 seconds during every deployment.

Root Cause

Old container is stopped before the new one is ready. No graceful handoff of traffic.

How to Fix
  1. Use rolling deployments — start new instance before killing old one
  2. On Kubernetes: configure `RollingUpdate` strategy with `maxUnavailable: 0`
  3. With Docker on a single host: use a blue-green approach — run both containers, switch nginx upstream, then stop old one
  4. Add health check to new container and wait for it to pass before routing traffic
  5. Configure nginx upstream with keepalive and `proxy_next_upstream error timeout`