Connection Draining Patterns

Graceful LB removal.

Overview

Connection draining is what makes deploys zero-downtime. Backends remove themselves from the load balancer cleanly, in-flight requests complete, then the process exits. Without it, every deploy drops a slice of requests and customers see the difference. With it, deploys become invisible.

The approach

Three habits make connection draining real rather than theoretical: health-check-driven drain, drain timeout tuned to actual request profile, and SIGTERM handlers that stop accepting new work while finishing in-flight requests.

Why this compounds

Each clean deploy preserves user experience that bad deploys would have damaged. The team’s deploy hygiene deepens; new services inherit the drain conventions instead of recreating them through customer-impact incidents.