Published May 18, 2018 by

AWS EC2- Elastic Load Balancer

Elastic Load Balancer (ELB) automatically distributes incoming request traffic across multiple Amazon EC2 instances and results in achieving higher fault tolerance. It detects unfit instances and automatically reroutes traffic to fit instances until the unfit instances have been restored in a round-robin manner. However, if we need more complex routing algorithms, then choose other services like Amazon Route53.

ELB consists of the following three components.

Load Balancer
This includes monitoring and handling the requests incoming through the Internet/intranet and distributes them to EC2 instances registered with it.

Control Service
This includes automatically scaling of handling capacity in response to incoming traffic by adding and removing load balancers as required. It also performs fitness check of instances.

SSL Termination
ELB provides SSL termination that saves precious CPU cycles, encoding and decoding SSL within your EC2 instances attached to the ELB. An X.509 certificate is required to be configured within the ELB. This SSL connection in the EC2 instance is optional, we can also terminate it.

Features of ELB

  • ELB is designed to handle unlimited requests per second with gradually increasing load pattern.
  • We can configure EC2 instances and load balancers to accept traffic.
  • We can add/remove load balancers as per requirement without affecting the overall flow of information.
  • It is not designed to handle a sudden increase in requests for online exams, online trading, etc.
  • Customers can enable Elastic Load Balancing within a single Availability Zone or across multiple zones for even more consistent application performance.

Create A Load Balancer

Step 1 − Go to Amazon EC2 console.

Step 2 − Select your load balancer region from the region menu on the right side.

Step 3 − Select Load Balancers from the navigation pane and choose to Create Load Balancer option. Choose classic load balancer. A pop-up window will open and we need to provide the required details.

Step 4 − In load Balancer name box: Enter name of your load balancer.
In creating LB inside box: Select the same network which you have selected
for instances.
Also Select Enable advanced VPC configuration if selected default VPC.

Step 5 − Click the Add button and a new pop-up will appear to select subnets from the list of available subnets as shown in the following screenshot. Select only one subnet per availability zone. This window will not appear if we do not select Enable advanced VPC configuration.

Step 6 − Click the Next: Assign Security Groups button and create a new security group for the load balancer.

Step 7 − A new pop-up will open having health checkup configuration details with default values. Values can be set on our own, however, these are optional. Click on Next: Add EC2 Instances.

Step 8 − A pop-up window will open having information about instances like registered instances, add instances to load balancers by selecting ADD EC2 Instance option and fill the information required. Click Add Tags.

Step 9 − Adding tags to your load balancer is optional. To add tags click the Add Tags Page and fill the details such as key, value to the tag. Then choose to Create Tag option. Click Review and Create button.

A review page opens on which we can verify the setting. We can even change the settings by choosing the edit link.

Step 10Click Create to create your load balancer and then click the Close button.

Delete a Load Balancer

Step 1 − Go to Amazon EC2 console.

Step 2 − Choose Load Balancers option from the navigation pane.

Step 3 − Select Load balancer and click the Action button.

Step 4 − Click the Delete button. An alert window will appear, click the Yes, Delete button.