🟑

Connection Draining / Deregistration Delay

  • CLB calls it Connection Draining
  • ALB and NLB call it Deregistration Delay
  • Ensures in-flight requests complete before an instance is removed (deregistered or marked unhealthy)
  • LB stops sending new requests to the instance while it’s draining
  • Configurable time: 1–3600 seconds (default 300s)
  • Disable by setting to 0
  • Use a shorter delay for short-lived requests to speed up deployments

Use Case

  • Gracefully shut down instances during:
    • Deployments
    • Auto Scaling down events
    • Maintenance operations
  • Prevents user disruption by letting current requests finish

Behavior

  • Draining state:
    • Existing connections are served until completion
    • No new connections sent to that target
    • New traffic is routed to healthy targets only