5

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.

  • I wonder if "no active connections" is only possible with an unhealthy/unresponsive target. It would seem wrong to count health checking connections in "active," but balancers do seem to keep them open and reuse them. Do you see connections via `netstat`? – Michael - sqlbot Jul 03 '18 at 18:32
  • @Michael-sqlbot good call, I'll try to ssh on a draining container and run a network diagnostic on it. – Laurent Jalbert Simard Jul 04 '18 at 01:22
  • 1
    I don't know if this was there when you looked at it, but the docs now say "However, even though target deregistration is complete, the status of the target will be displayed as draining until the deregistration delay elapses." – sandinymyjoints Mar 28 '19 at 19:42

1 Answers1

6

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.

Steven
  • 176
  • 1
  • 3