Amazon ALB – Fix Connection Draining Reaching Deregistration Delay

amazon-albamazon-ecsamazon-elb

I'm using ECS along with ALB to expose my containers to the internet. When I'm updating a container image (I'm using CloudFormation to update the tasks and services), the target group set the connections to the old containers to Draining. The issue is that this step always take a full 5 minutes which is the same as my Deregistration Delay attribute.

According to the doc, this shouldn't happen:

Deregistration Delay Elastic Load Balancing stops sending requests to
targets that are deregistering. By default, Elastic Load Balancing
waits 300 seconds before completing the deregistration process […].

If a deregistering target has no in-flight requests and no active
connections, Elastic Load Balancing immediately completes the
deregistration process, without waiting for the deregistration delay
to elapse.

The obvious explanation would be that I have a persistent connection to the container. However, I'm experiencing the issue on a test service that only myself is aware of.

Best Answer

The documentation has meanwhile been updated:

If a deregistering target has no in-flight requests and no active connections, Elastic Load Balancing immediately completes the deregistration process, without waiting for the deregistration delay to elapse. However, even though target deregistration is complete, the status of the target will be displayed as draining until the deregistration delay elapses.