- Newest
- Most votes
- Most comments
Based on your description, the Application Load Balancer itself is unlikely to be causing a delay in your code updates. The issue you're experiencing appears to be related to your deployment process rather than the load balancer's behavior.
Here are the most likely causes:
Traffic Routing to Old Instances: If your deployment process creates new instances but doesn't properly deregister the old ones, the load balancer will continue routing traffic to both old and new targets. This means some requests hit your updated code while others hit the old version, making it appear as though updates aren't taking effect.
Deregistration Delay: When targets are deregistered (removed from the target group), there's a deregistration delay period during which the load balancer continues to route existing requests to those targets. If your deployment process isn't accounting for this, you might be seeing traffic still going to old instances that should have been removed.
DNS Caching: Since you mentioned Cloudflare DNS, there could be DNS caching occurring at multiple levels - in Cloudflare, in clients' DNS resolvers, or in your application's HTTP clients. Even though your load balancer is updated, cached DNS responses might be directing traffic to old endpoints.
Recommendations:
- Verify that your Jenkins deployment process is properly updating the target instances and that old instances are being deregistered from the target group
- Check that all instances in your target group are running the updated code
- Ensure your deployment strategy (blue/green, rolling update, etc.) is correctly configured
- Review your target group's deregistration delay settings and adjust if needed for your deployment process
- Clear DNS caches and verify that your application isn't independently caching DNS responses
The load balancer itself doesn't cause delays in code deployment - it simply routes traffic to whatever targets are registered in its target groups. The issue is most likely in how your deployment process interacts with the target group registration.
Sources
Troubleshoot your Application Load Balancers - Elastic Load Balancing
Get notified when Application Load Balancer IPs change | AWS re:Post
Do you also have an auto scaling group associated with the load balancer? If so, will any new instances also get the updated code? If not, then you already know where the issue lies. Depending on your update process, are you updating all the servers at once or performing a rolling update. With rolling update, there will be times of inconsistency? Finally, will the application be cached on their client's browser, if so, you will need to invalidate the cache.
Relevant content
- asked 2 years ago
