AWS Connection Draining / Deregistration Delay
- Concept Overview:
- Connection Draining (Classic Load Balancer) or Deregistration Delay (Application/Network Load Balancer) is a feature that allows in-flight requests to be completed before an instance is deregistered or marked as unhealthy.
- During the draining period, the load balancer stops routing new requests to the target that is being deregistered.

- Operational Mechanism:
- When an instance is put into draining mode, it is allowed to finish handling ongoing requests.
- New incoming requests are routed to other healthy instances by the load balancer.
- Configuration Parameters:
- The draining period can be set between 1 to 3,600 seconds (1 hour).
- By default, the period is set to 300 seconds (5 minutes).
- Setting the value to zero disables Connection Draining entirely.
- Use Cases:
- For short-lived requests (e.g., less than one second), a lower draining period (e.g., 30 seconds) is suitable.
- For longer requests (e.g., file uploads or streaming), a higher draining period is recommended to ensure requests are not interrupted.
- Trade-offs:
- A lower value for Connection Draining allows for faster instance replacement but may interrupt active requests.
- A higher value ensures all requests are completed but delays instance replacement.
- Exam Relevance:
- Understanding Connection Draining/Deregistration Delay is important for the AWS certification exam.
- Be aware of the default settings and how to adjust them based on different use cases.
Remember to configure the Connection Draining or Deregistration Delay settings based on the specific needs of your application and the expected request duration to ensure a balance between service availability and resource management.