Connection draining for longer lasting connections (>1hour)

0

My customer is running their application on EC2 instances in an Auto-Scaling Group behind a Classic Load Balancer. But, the application sometimes has connections lasting hours. They are looking to implement continuous deployment for the application. Their plan is to create a new ASG with new deployment, attach it to the CLB and detach the old ASG from the CLB.

Since the load balancer's maximum connection draining timeout is 60 minutes, it will destroy any in-flight connections at the top of the hour and the instance will be terminated by the ASG.

Can they use “Update DNS Routing with Amazon Route 53” approach from https://d1.awsstatic.com/whitepapers/AWS_Blue_Green_Deployments.pdf If so, when they route 100% of the traffic to new deployment, the existing connections to old deployment will be still be alive?

Are there any other alternative approaches they can follow? Do they need to implement custom logic to route and drain connections? Is there any feature in AWS services that they can leverage?

AWS
Hareesh
asked 5 years ago1143 views
1 Answer
0
Accepted Answer

They can, but note that this will not utilize connection draining, as they'd be changing DNS to point at a different ELB. When that happens, existing connections to the old load balancer are unaffected until the client re-connects or re-resolves DNS.

Another option is they could attach the new ASG not detach the old ASG, instead having all of the backends in the old ASG fail their health checks. They could then wait the (desired draining time - the configured draining time) and de-register the ASG then. The advantage of this over Route53 is the client's don't have to worry about DNS, you don't have to maintain 2 ELBs, and you can have draining time however long you desire. This works because CLB treats unhealthy backends similarly to de-registered ones, allowing in-flight requests to complete and not sending new requests. Note that TCP listeners a connection to an unhealthy target won't be interrupted by the ELB, and will only fail or close if the client or backend causes it to.

AWS
EXPERT
zobAWS
answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions