0

In my AWS VPC I have an application load balancer and two target groups. Each target group has only 1 instances in different az with health check setup.

Now when one of my instance in a target group goes down AWS correctly marks its as unhealthy. But my application load balancer still keeps sending requests to it, causing my application to work intermittently.

enter image description here

But in the documentation it's clearly mentioned that unhealthy instances are ignored by the load balancer.

I checked all the LB and TG configuration none suggest that they shouldn't be ignored.

It monitors the health of its registered targets, and routes traffic only to the healthy targets.

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html

botchedDevil
  • 260
  • 1
  • 4
  • 14

1 Answers1

0

There is an exception from this rule. From docs:

If a target group contains only unhealthy registered targets, the load balancer nodes route requests across its unhealthy targets.

So basically, if all targets are unhealhty, ALB will ignore this fact and attempt to route requests to the targets anyway.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • I thought so too, forgot to mention that I tried and kept both instances in the same target group. So basically one healthy and one unhealthy and still both instances were been requested. – botchedDevil Apr 04 '21 at 09:55
  • @botchedDevil Your screenshot shows only one target, so I'm not sure which two instances are you referring to? – Marcin Apr 04 '21 at 10:03
  • 1
    @botchedDevil There is also de-registration time. You may had to wait longer? – Marcin Apr 04 '21 at 10:14
  • Yes As I said I forgot to mention that case when I had put two instances in the same Target Group. I was still getting the issue – botchedDevil Apr 04 '21 at 10:22
  • @botchedDevil Please double check. There must be something more that maybe you missed or forgot to mention. – Marcin Apr 04 '21 at 10:29
  • No that's it, let me know if you need to know anything specific! – botchedDevil Apr 04 '21 at 10:35