background preloader

LoadBalance-AutoScale

Facebook Twitter

The “Elastic” in “Elastic Load Balancing”: ELB Elasticity and How to Test it. Update March 2012: Amazon published their own official guide to ELB’s architecture and building and testing applications that use it.

The “Elastic” in “Elastic Load Balancing”: ELB Elasticity and How to Test it

The official material is very consistent with the presentation offered here, more than two and a half years prior. Elastic Load Balancing is a long-anticipated AWS feature that aims to ease the deployment of highly-scalable web applications. Let’s take a look at how it achieves elasticity, based on experience and based on the information available in the AWS forums (mainly this thread). The goal is to understand how to design and test ELB deployments properly. ELB: Two Levels of Elasticity ELB is a distributed system. Why does Amazon use a DNS name? Here is the step-by-step flow of what happens when a client requests a URL served by your application: The client looks in DNS for the resolution of your web server’s name, www.mydomain.com. As you can see, there are two levels of elasticity in the above protocol.

How ELB Distributes Traffic. ELB Reference — boto v2.14.0. How to load balance two EC2 machines on AWS. In my last post, I described the benefits of a load balancer.

How to load balance two EC2 machines on AWS

This post contains the step-by-step guide for load balancing two EC2 machines using the AWS console. The customer service I am load balancing is a Drupal CMS. I add a load balancer to help make the service operationally ready. I am not doing anything with DNS. The new load balancer's URL is the exceedingly unattractive Check the services. Make sure both VMs are providing my new Drupal service.

Open a web browser. Both pages display a welcome message saying Welcome to ec2-1-2-3-4.eu-west-1.compute.amazonaws.com. 1-2-3-4? If I don't get these results, then I have some bug hunting to do. If I do get these results I am ready to load balance my service. Concepts - Elastic Load Balancing. A load balancer accepts incoming traffic from clients and routes requests to its registered EC2 instances in one or more Availability Zones.

Concepts - Elastic Load Balancing

The load balancer also monitors the health of its registered instances and ensures that it routes traffic only to healthy instances. When the load balancer detects an unhealthy instance, it stops routing traffic to that instance, and then resumes routing traffic to that instance when it detects that the instance is healthy again. You configure your load balancer to accept incoming traffic by specifying one or more listeners. A listener is a process that checks for connection requests. It is configured with a protocol and port number for connections from clients to the load balancer and a protocol and port number for connections from the load balancer to the instances. Before a client sends a request to your load balancer, it resolves the load balancer's domain name using a Domain Name System (DNS) server. Availability Zones and Instances. AWS Elastic Load Balancer Tutorial. We’ve been using the new Amazon Load Balancers (ELB) for Socialmod, and since there’s not much information out there on the subject, I thought a blog post would be in order.

AWS Elastic Load Balancer Tutorial

The load balancers are charged at $0.025 per hour, plus $0.008 per GB of data transferred through them. Personally I think this is very reasonable. They’re hardware based, and can balance both HTTP and TCP traffic. This means you can balance both the traffic to the web server, and the database traffic (although there are issues with the latter that I’ll talk about later). Some of the following instructions are specific to OSX/Linux, check the docs for information about Windows. Setting up the tools. Download the tools from Amazon, unzip them and place them somewhere logical (in your home directory for example). Edit your .bash_profile file (or .profile), adding the following line: export ELB_HOME=~/path/to/elastic_load_balancing export PATH=$PATH:$ELB_HOME/bin. Testing Your AWS Elastic Load Balancer. Vijay Ramachandran asked me, via twitter, how to test if an Amazon Elastic Load Balancer is really doing it’s job.

Testing Your AWS Elastic Load Balancer

Because 140 characters really isn’t sufficient space to handle this answer, I’ve created this post. Feel free to use any of this in any of your environment. First, I’ll assume you’ve covered some of the basics with ELB. The default configuration you’ll end up with following my guides above is a stateless system that distributes the requests more or less evenly across all configured servers. However, when you do it the first time, it’s nice to see that it’s actually doing what you think it should be.