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
已提問 5 年前檢視次數 1161 次
1 個回答
0
已接受的答案

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
專家
zobAWS
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南