Elastic Load Balancer (ELB)
One useful benefit of cloud computing is that it supports scalability (the abilityto provision large amounts of computing capacity) and elasticity (the abilityto easily and rapidly grow and shrink the computing capacity assigned toyour application). You caneasily start and stop instances and add them to, or remove them from, your application, paying only for the computing capacity you consume.
One key requirement for taking advantage of these benefits is the ability to direct network traffic to these instances, and a load balancer is the solutionto this requirement. A load balancer spreads load across multiple computing resources that offer the same functionality, improving the overall application performance. If you have four instances that operate as web servers, forexample, a load balancer directs traffic to each of the four so that no web server is overloaded and all users experience better performance.
One challenge of using AWS is that, because of its elasticity support, instances may frequently join or leave a resource pool, so a load balancer needs to easily allow both registration and deregistration. Registration refers to the process of a computing resource (in this case, an AWS instance) making the load balancer aware of the instance’s availability and setting up the network connection between the load balancer and the instance so that traffic can flow between them. Deregistration performs the process in reverse — it removes the instance from the load balancer’s connection list, which causes the load balancer to stop sending traffic to the instance.
Elastic Load Balancing (ELB), designed to offer these benefits:
✓ Load balancing as a service: ELB is designed to make it easy to support load balancing without requiring AWS users to manage load balancer resource pools. As is typical of Amazon, it designed a service to simplify important application functionality, thereby giving users an easier way to use AWS.
✓ Automated load balancing scalability and elasticity: Instead of user shaving to manage load balancer pools, requiring constant monitoring and administration, Amazon designed its load balancing service to automatically support more (or less) traffic with no user interaction required.
✓ Easy registration and deregistration: ELB reduces the overhead of getting an instance known to a load balancer so it can register and deregister the instance. ELB automates that process, making setup and teardown much faster and less error-prone.
✓ Low cost: Consistent with Amazon’s overall AWS philosophy, ELB isn’t only inexpensive, but you also pay for only the ELB capacity you use.
Amazon supports ELB via the AWS API and Management Console.
ELB functionality
ELB provides these features:
✓ Easy creation of ELBs: A simple API call or use of the AWS Management Console allows users to automatically create an ELB. Upon creation, the ELB is assigned a DNS identifier, such as LB1-26746260.us-east-1.elb.amazonaws.com. Traffic sent to this DNS domain is automatically spread among all instances registered to the ELB.
✓ Easy registration and deregistration of instances: AWS makes it easy to connect an instance with an ELB or to remove the connection. This makes leveraging AWS’s scalability and elasticity easier for users, which is good for everyone.
✓ Support of multiple availability zones (AZs): The instances registered with an ELB can be placed in multiple AZs, providing better application robustness and protection against downtime in the event of an entire AZ going offline. ELB distributes traffic evenly between AZs. If you decide to use the ELB multi-AZ support, you should understand that each AZ will receive roughly the same amount of traffic; therefore, you should plan to haveroughly equal numbers of instances running in each AZ to avoid one AZ’s instances from being overwhelmed with traffic.
✓ Support of encryption via Secure Socket Layer (SSL) technology: ELBs offer automated support of Secure Socket Layer (SSL) encryption, which, if you’ve ever had to manage SSL certificates, you’ll know isn’t trivial. If you have ELB encryption support, you can make your applications more secure while still achieving high scalability and elasticity.
✓ Support for session affinity: Session affinity (also known as sticky sessions) refers to the ability to associate a user’s connection to a particular instance, directing all subsequent user traffic back to the same instance that the first connection from the user was sent to. Applications can then store session state information (username andID, for example) in the instance, allowing easier application design and better performance.
✓ Domain name assignment: Even though ELB assigns a DNS name toyour ELB, you wouldn’t want all of your customers who want to contact your corporate website to have to enter LB1-26746260.us-east-1.elb.amazonaws.com in their browsers. ELB makes it easy for you to associate a more user-friendly domain name (www.yourcompanyname.com) to the ELB DNS name, allowing user traffic automatically to be redirected from your domain name to the highly scalable ELB.
✓ Instance health monitoring: AWS monitors instances registered with anELB; if an instance stops performing, the ELB automatically stops sending traffic to it. This prevents traffic from being directed to an instance that won’t respond and reduces the likelihood of having dissatisfied application users.
✓ Support of autoscaling: AWS offers autoscaling, which uses application load to automatically trigger additional instance launches to support application traffic. If you configure your application to use autoscaling, AWS automatically adds (or subtracts) instances as necessary.
Instance IP addresses are ephemeral: AWS assigns each new instance an IP address at random. If you stop and restart an instance that’s registered with the ELB, therefore, the ELB is unaware of the new instance and, consequently, doesn’t send traffic to it. The right way to handle this situation is to deregister instances upon shutdown and to be sure to register new instances on start-up. (The AWS Auto Scaling service also alleviates this issue.
ELB scope
ELBs are regional in scope. This concept is quite important to understand in that an ELB cannot distribute an application’s traffic across multiple regions.To distribute traffic across multiple regions, you should look at other solutions,including the use of one of the load balancer products available as images within AWS.
ELB cost
ELB cost varies by region, but, overall, the cost of ELB is quite reasonable. An ELB costs, per hour (depending on region), between $.028 and $.034. There’s also a traffic charge for ELBs, which runs between $.008 and $.011 per gigabyte.