Elastic Load Balancing

Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve even greater fault tolerance in your applications, seamlessly providing the amount of load balancing capacity needed in response to incoming application traffic. Elastic Load Balancing detects unhealthy instances within a pool and automatically reroutes traffic to healthy instances until the unhealthy instances have been restored. Customers can enable Elastic Load Balancing within a single Availability Zone or across multiple zones for even more consistent application performance.

  To access Elastic Load Balancing:
Sign Up for Amazon EC2



Features of Elastic Load Balancing

  • Using Elastic Load Balancing, you can distribute incoming traffic across your Amazon EC2 instances in a single Availability Zone or multiple Availability Zones. Elastic Load Balancing automatically scales its request processing capacity in response to incoming application traffic.
  • Elastic Load Balancing can detect the health of Amazon EC2 instances. When it detects unhealthy load-balanced Amazon EC2 instances, it no longer routes traffic to those Amazon EC2 instances instead spreading the load across the remaining healthy Amazon EC2 instances.
  • Elastic Load Balancing supports the ability to stick user sessions to specific EC2 instances.
  • Elastic Load Balancing metrics such as request count and request latency are reported by Amazon CloudWatch.
  • If you’re signed up for the Amazon EC2 service, you’re already registered to use Elastic Load Balancing and can begin using the feature via the Elastic Load Balancing APIs or Command Line Tools.

Using Elastic Load Balancing

Getting started with using Elastic Load Balancing is easy. If you are signed up for the Amazon EC2 service, you are automatically registered for Elastic Load Balancing. To use Elastic Load Balancing, simply:

  • Download the Command Line Tools from Amazon EC2 API tools.
  • Use the elb-create-lb command to create an Elastic Load Balancer.
  • Use the elb-register-instances-with-lb command to register the Amazon EC2 instances that you want to load balance with the Elastic Load Balancer.
  • Elastic Load Balancing automatically checks the health of your load balancing Amazon EC2 instances. You can optionally customize the health checks by using the elb-configure-healthcheck command.
  • Traffic to the DNS name provided by the Elastic Load Balancer is automatically distributed across your load balanced, healthy Amazon EC2 instances.

All the commands mentioned above are also available as Elastic Load Balancing APIs.


Common Uses for Elastic Load Balancing

Achieving Even Better Fault Tolerance for Your Applications

You can build fault tolerant applications by placing your Amazon EC2 instances in multiple Availability Zones. To achieve even more fault tolerance with less manual intervention, you can use Elastic Load Balancing. You get improved fault tolerance by placing your compute instances behind an Elastic Load Balancer, as it can automatically balance traffic across multiple instances and multiple Availability Zones and ensure that only healthy Amazon EC2 instances receive traffic. You can setup an Elastic Load Balancer to load balance incoming application traffic across Amazon EC2 instances in a single Availability Zone or multiple Availability Zones. Elastic Load Balancing can detect the health of Amazon EC2 instances. When it detects unhealthy Amazon EC2 instances, it no longer routes traffic to those unhealthy Amazon EC2 instances. Instead, it spreads the load across the remaining healthy Amazon EC2 instances. If all of your Amazon EC2 instances in a particular Availability Zone are unhealthy, but you have set up Amazon EC2 instances in multiple Availability Zones, Elastic Load Balancing will route traffic to your healthy Amazon EC2 instances in those other zones. It will resume load balancing to the original Amazon EC2 instances when they have been restored to a healthy state.

Auto Scaling with Elastic Load Balancing

Let’s say that you want to make sure that the number of healthy Amazon EC2 instances behind an Elastic Load Balancer is never fewer than two. You can use Auto Scaling to set these conditions, and when Auto Scaling detects that a condition has been met, it automatically adds the requisite amount of Amazon EC2 instances to your Auto Scaling Group. Or, if you want to make sure that you add Amazon EC2 instances when latency of any one of your Amazon EC2 instances exceeds 4 seconds over any 15 minute period, you can set that condition, and Auto Scaling will take the appropriate action on your Amazon EC2 instances — even when running behind an Elastic Load Balancer. Auto Scaling works equally well for scaling Amazon EC2 instances whether you’re using Elastic Load Balancing or not.


Projecting Costs

With Elastic Load Balancing, you only pay for what you use. You are charged for each hour or partial hour your Elastic Load Balancer is running and for each GB of data transferred through your Elastic Load Balancer. You will be charged at the end of each month for your Elastic Load Balancing resources actually consumed.

As an example, a medium-sized website running on 10 Amazon EC2 instances in the US East (N. Virginia) Region could use one Elastic Load Balancer to balance incoming traffic. If the Elastic Load Balancer ended up transferring 100 GB of data over a 30 day period, the monthly charge would amount to $18 (or $0.025 per hour x 24 hours per day x 30 days x 1 Elastic Load Balancer) for the Elastic Load Balancer hours and $0.80 (or $0.008 per GB x 100 GB) for the data transferred through the Elastic Load Balancer, for a total monthly charge of $18.80. Partial hours are billed as full hours. Regular Amazon EC2 service fees apply and are billed separately.

Resources

©2010, Amazon Web Services LLC or its affiliates. All rights reserved.