Connection Draining (Deregistration Delay) in AWS Load Balancers

Overview

Connection Draining (for Classic Load Balancers) or Deregistration Delay (for Application Load Balancers and Network Load Balancers) is a feature that ensures in-flight requests are completed before an instance is removed from service. This mechanism prevents abrupt connection drops when an instance is deregistered or marked unhealthy.

How It Works

  1. When an instance enters draining mode, the Elastic Load Balancer (ELB) stops routing new requests to it.
  2. Existing connections are given time (draining period) to complete their active requests.
  3. Once the draining period expires or all connections are closed, the instance is fully deregistered.
  4. Any new incoming requests are routed to other available instances.

Example Scenario

Configuring Connection Draining

You can configure the Connection Draining time between 1 and 3,600 seconds (5 minutes by default).

Key Considerations