Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Codedeploy BlockTraffic/AllowTraffic durations

Tags:

I've been using AWS CodeDeploy to push our applications live, but it always takes ages doing the BlockTraffic and AllowTraffic steps. Currently, I have an application load balancer(ALB) with three EC2 nodes initially(behind an autoscaling group). So, If I do a CodeDeploy OneAtATime, the whole process takes up to 25 minutes.

The load balancer I'm using it with had connection draining set to 300s. I thought it was the reason for drag out. However, I disabled Connection Draining and got the same results. I then enabled Connection Draining and set timeout to 5 seconds and still got the same results.

Further, I found out CodeDeploy depends on the ALB Health Check settings. according to the AWS documentation

After an instance is bound to the ALB, CodeDeploy waits for the status of the instance to be healthy ("inService") behind the load balancer. This health check is done by ALB and depends on the health check configuration.

So I tried by setting low timeouts and thresholds for health check settings. Even those changes didn't reduce the deployment time much.

Can someone direct me to a proper solution to speed up the process?

like image 408
Chamin Wickramarathna Avatar asked Aug 08 '19 07:08

Chamin Wickramarathna


1 Answers

The issue is the de-registration of instances from the AWS target group. You want to change this value:

enter image description here

or find a way to update the deregistration_delay.timeout_seconds property - by default it's 300s, which is 5 minutes. The docs can be found here).

like image 183
Prisoner Avatar answered Sep 28 '22 19:09

Prisoner