Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS ELB - will it retry request if node fails?

I have an ELB and 3 nodes behind it.

Can someone please explain me what will ELB do in these scenarios:

  1. Client Request -> ELB -> Node1 fails in the middle of the request (ELB timeout)
  2. Client Request -> ELB -> Node1 timeouts (Server timeout and health check haven't kicked in yet)

Particularly I'm wondering if ELB retries the request to another node?

I made a test and it doesn't seem to, but maybe there's a setting that I've missed.

Thanks,

like image 665
sparrovv Avatar asked Aug 04 '15 20:08

sparrovv


People also ask

What happens when ELB fails?

If an individual ELB instance were to fail, it would be replaced automatically, much in the way autoscaling replaces failed instances. You can usually tell how many instances are in your ELB by doing a DNS lookup - you will see multiple IP addresses returned.

Is ELB single point of failure?

Although it might seem that ELB is a single point of failure, the ELB is in fact comprised of multiple instances managed by AWS. Also in this scenario, we now have three instances running our application.


Video Answer


2 Answers

This may have been a matter of passage of time, but these days ELBs do retry requests that abort:

  • Either because of an Idle Timeout (60s by default);
  • Or because the instance went unhealthy due to failing health checks, with Connection Draining disabled (default is enabled)

However, this holds only if you haven't sent any response bytes yet. If you have sent incomplete headers, you will get a 408 Request Timeout. If you have sent full headers (but didn't send a body or got halfway through the body) the client will get the incomplete response as-is.

The experiments I've performed were all with a single HTTP request per connection. If you use Keep-Alive connections, the behavior might be different.

like image 189
rix0rrr Avatar answered Sep 23 '22 06:09

rix0rrr


The AWS Elastic Load Balancing service uses Health Checks to identify healthy/unhealthy Amazon EC2 instances. If an instance is marked as Unhealthy, then no new traffic will be sent to that server. Once it is identified as Heathy, traffic will once again be sent to the instance.

If a request is sent to an instance and no response is received (either because the app fails or a timeout is triggered), the request will not be resent nor sent to another server. It would be up to the originator (eg a user or an app) to resend the request.

like image 31
John Rotenstein Avatar answered Sep 22 '22 06:09

John Rotenstein