Lab9: Introduction to Elastic Load Balancing

This lab I will demonstrate the following contents:

  • Creating an Elastic Load Balancer And Adding an Elastic Instance to an Elastic Load Balancer

What is Amazon Elastic Load Balancer:

An Amazon Elastic Load Balancer is the automatically distributes incoming application traffic service across multiple Amazon EC2 instance. 

Elastic Load balancer offers two type of services: 1. Classic load Balancer and 2. Application Load balancer. In this lab, I will discuss the configuration of Classic Load Balancer.

Benefits of Amazon Elastic Load Balancer: It helps you to handle fault tolerance in your applications system. It seamlessly giving the load balance capacity amount needed in response to incoming application traffic. It can able to detect unhealthy instance within a pool and reroutes its traffic to healthy instance automatically until restore the unhealthy instances.

Amazon Elastic Load balancing can be enabled within a single Availability Zone or among multiple Availability Zone for maintaining the more consistent performance of applications. you can also be used it to shared traffic between application tiers in Amazon Virtual private Cloud (VPC).

Steps for the task: Creating an Elastic Load Balancer And Adding an Elastic Instance to an Elastic Load Balancer

  1. Click EC2 on the Services Menu in the AWS Management Console. From the left navigation pane, click “Create Load Balancer” and select “Classic Load Balancer“.1.jpg
  2. Provide the name of Load Balancer. I put the name “free-lab-load balancer”. You can provide your owner choice name but remember “The name must contain alphanumeric characters or dashes without any spaces”2.jpg
  3. In the listener Configurations, Provide the load balancer protocol. That is traffic from outside your network can be routed from any load balancer port to any port on your Amazon EC2 instances. By default, AWS services configured load balancer with a standard web server on port 80. You can add more TCP protocol ports there.
  4. In the Define Load Balancer page after listener configuration, You need to select subnet which must be available. This is because of which Availability Zone you want your traffic would be routed by your load balancer.  Note: The AWS recommendation is to select minimum two subnets in different Availability Zone for higher availability for load balancer if you have only one Amazon Instance.3.jpg
  5. Click “Next: Assign Security Groups“. In the security group screen, you will get two options 1. To Create a new security group; 2. select an existing security group. Note: If you don’t have any security group, then select create a new group and this security group for your load balancer which will control traffic flow;  However; I have an exciting security group that I made on my lab2: VPC. I selected existing security group.4.jpg
  6. Click “Next: Configure Security Setting“.leave it by default and click Next: Configure Health Check”.  Note: The load balancer will perform health checks for your EC2 instance automatically and traffic will route to the instance which will be passed by health check. fail instance will be removed from load balancer automatically. You can customise your health check from advanced customised options.5.jpg
  7. Next: Add EC2 Instances.  Note: You can add only one instance or you can add multiple instances into one load balancer.  It is cost reducing if you add all of your EC2 instances into one Load balancer and configure the second load balancer for failover if the first load balancer fail. 6.jpg
  8. Next: Add Tags. Give a relevant name tag to your Load balancer. Note: A tag helps you to identify and re-organise your resources in the cloud platforms if you are using serval different services. 7.jpg
  9. Click create after complete your review. It will take a few seconds for processing to create the load balancer.8.jpg
  10. Now you can view your newly created load balancer to go EC2 instance dashboard and select load balancer from load balancing tab. 10.jpg
  11. At the bottom of the screen click “Instance“, wait for several minutes until they become available. They are usually be listed as “OutOfServices” until they fully activated.
  12. If your instance “OutOfService” with the status that one of your thresholds failed to pass health check status. In this case, You have to remove your instance from the Load balancer. Your health report will be “Availability Zone contains no healthy instances”11.jpg
  13.  If you get your instance “In service” for all instance you assigned under load balanced. Click “Description” tab and find the “DNS Name” field. Note: Resources and load balancer take the minimum of 10 minutes to created URL in the DNS name field.

14. Copy and paste your DNS Name URL except for a Record part at the end in your web browser. You will get Load balanced page. After opening your load balancing page for running instance, on the back end, your request will be being excute between load balance and your instance.

Question: What is classic load balancer? 

Answer: The classic load balance is the traffic based routes that passing information on the application or network level. If you want to balance traffic among EC2 instance, Amazon Classic Load Balance is the best suit consider its providing offers. and when you require automatic scaling, high availability, robust security and automatic scaling.

The features of classic load balancer: 

  • High Availability and Health Check
  • Security balance when you assigned load balanced through VPC
  • SSL Offloading and Sticky Sessions
  • IPv6 Support (Currently unavailable for VPC)
  • Layer 4 or Layer 7 Load Balancing
  • Operational Monitoring and Logging

Question: How manyAmazon Elastic load balanced I can create in one region?

Answer: Maximum of 20 load balancer you can create in a region including classic and application Load balancers.

Cost Analysis:

Classic Load Balancer Pricing 

Price Method: You will be paid what you use. 

Charged applicable for running load balancer each hour or partial for each GB of data transferred through your load balancer considered as a full hour.

Payment time: At the end of each month after calculating how much data your elastic load balancing resources consumed.

 Calculating procedure: 

Region: US West (Oregon)

  • $0.025 per Elastic Load Balancer-hour (or partial hour)
  • $0.008 per GB of data processed by an Elastic Load Balancer

Suppose, If you are running a medium size website like your company websites. Your region is US West and you use one load balancer to distribute your incoming traffic. 

Let’s, If you pay $0.025 per hours,  the monthly charged will be = $0.025 per hour * 24 hours per day * 30 days a month * 1 load balancer * = $18.00 

and If you pay $0.0.08 per GB and your total load balancer transferred 150 GB data over the month (30 days). The price will be = $0.008 *  150 = $12.00

Your total monthly cost is = $18.00 + $12.00 = $30.00. Note: Partial hours are also considered as full hours when they will bill you.

Cost reducing suggestion: Blocking unnecessary traffic through VPC security group setting or stop your unused running instance can help you reducing the price.

Thank you 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s