Search code examples
amazon-web-servicesamazon-ec2elastic-load-balancer

Amazon Elastic Load Balancing - One instance stopped working


I'm having two EC2 instances running behind an Elastic Load Balancer (ELB). When one EC2 instance not responding, the request redirected by ELB to that instance will get a TIMEOUT response.

Is there anyway to prevent this, for example, redirect to other instances if the current one's load is high or not working?


Solution

  • The Elastic Load Balancer supports a Health Check. The load balancer performs the health check at regular intervals (eg every 10 seconds) to check the health of the Amazon EC2 instances connected to the Load Balancer.

    If an instance fails the health check a given number of times, the load balancer will stop sending traffic to the instance. The load balancer will continue performing the health check and, if the instance again passes the health check a given number of times, the load balancer will again serve traffic to the instance.

    See: