Why is my ELB routing requests to unhealthy targets?

0
15
Asked By CloudSurfer88 On

I've recently started a new role where I've inherited an Elastic Load Balancer (ELB) setup. Currently, all the targets are showing as unhealthy because of some misconfigured health checks. However, the application that's exposed to the internet still seems to be functioning normally, as it routes requests to these unhealthy targets. Is this behavior normal, or am I misunderstanding what the purpose of the health checks is? In other projects outside of AWS, unhealthy targets typically mean that the service would return a 50x error due to a lack of available targets.

3 Answers

Answered By DevDude71 On

I’m dealing with something similar on an EKS-managed ALB, and my targets are often marked unhealthy too. It’s a bit of a headache, but I’m not sure if it’s worth the effort to fix them. It seems to work fine regardless.

Answered By NetNerd34 On

From what you've described, it sounds like your targets might be returning HTTP status codes in the 200-499 range. That's potentially why the ELB continues to route traffic there. If your health check status shows a timeout, consider implementing a specific health endpoint like '/health' that reliably returns a '200 OK'. This could help optimize your ELB configuration.

Answered By TechGuru99 On

It's actually expected behavior! With an Application Load Balancer (ALB), if all targets are unhealthy, it still routes traffic to them anyway, which is referred to as ‘fail open’. This means that the load balancer won't block requests, even though there's a health issue with the targets. Just make sure to check the health check configuration to understand why they’re failing.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.