Do you want to implement the automatic distribution of your incoming web traffic across Amazon EC2 instances on the Amazon AWS cloud? If yes, then the Amazon Elastic Load Balancing (ELB) service is your answer. Be it incoming website or application traffic, ELB can automatically distribute this traffic across many targets. These targets include Amazon EC2 instances along with containers and IP addresses.
Additionally, AWS ELB can handle your varying traffic across single – or multiple – availability zones. So, even as your application traffic scales or changes over time, ELB can automatically scale its capability according to the workloads.
In this Amazon ELB Blog, you will learn the below topics: |
Traditionally, load balancing worked by dividing the incoming traffic or users equally among multiple computers so that every user request is processed faster. In the case of ELB, the load balancer first checks the health of the targeted instances and routes the traffic only to healthy targets. Additionally, it stops directing traffic towards an unhealthy instance.
You can also configure your elastic load balancer to accept incoming traffic by selecting one or more listeners. Configured with a port number and network protocol, a listener checks for connection requests from clients to the load balancer.
Want to become a Certified AWS Solution Architect? Click here to learn AWS Online Training |
This load balancer is best designed for load balancing of HTTP/ HTTPS traffic and can route the incoming traffic towards the latest application architectures that include IP addresses, containers, EC2 servers, and Lambda functions.
The application load balancer is optimized to work with traffic that is routed to targets within the Amazon Virtual Private Cloud (or Amazon VPC).
This load balancer is best designed for load balancing of traffic that uses protocols like TCP, User Datagram Protocol (or UDP), and Transport Security Layer (or TSL), which require good performance.
This load balancer can handle millions of user requests each second between the client device and the target instance.
The network load balancer is optimized to work with volatile and dynamic workloads and for handling a sudden increase in incoming traffic.
This load balancer is best designed for basic load balancing that operates across multiple EC2 instances at both request and the connection level. The classic load balancer retrieves information – such as the network protocol and port number – from the incoming request and routes the traffic to the appropriate EC2 instance that is hosting the web application.
The classic load balancer is similar to traditional forms of load balancing using physical devices, except that this load balancer automatically performs balancing in a virtual environment. This load balancer is optimized to work with applications that were built in the classic EC2 network.
We shall learn about how to create these load balancers in later sections. For now, let’s discuss the various features and benefits of using ELB.
How does ELB differ from traditional load balancing? Here are 6 features that set it apart:
ELB service distributes all its AWS instances across only healthy channels. It can also detect unhealthy targets of EC2 instances and stop sending any traffic to them. During this process, it can identify and spread the workload across only healthy and working targets.
Prior to the implementation of this feature, ELB distributed its traffic evenly across all AWS availability zones. This usually resulted in service disruption or sometimes in performance degradation. It also used DNS information to distribute the traffic from the client device to the availability zones.
With cross-zone load balancing, ELB does not depend on implementing an equal number of AWS instances in each availability zone. Additionally, there is no issue regarding caching of DNS information.
With ELB, you can use the Amazon VPC tool to create and manage security groups that are associated with the ELB load balancers. This ensures better networking and security options. Additionally, you can create an internal (or off the cloud) load balancer.
Additionally, ELB has security enhancements like SSL termination and a security policy. Other enhancements include the Perfect Forward Secrecy along with Server Order Preference that boosts ELB security for application traffic.
Connection draining is a feature that is designed to prevent abrupt behavior of deregistered AWS instances when existing connections to that instance are lost. The connection draining process continues to serve these existing connections to deregistered instances for a configured timeout duration. As a result, users do not experience abrupt instance behavior during the deregistration process.
Amazon Route 53 now supports integration with ELB endpoints. With its DNS Failover feature, Route 53 can detect website outages and redirect users to another website or backup site.
With this integration, website users can configure multiple records for the same website domain from multiple regions using different ELBs. This enables high availability for applications using ELB.
With its integration with Amazon CloudWatch, ELB can now use its metrics to monitor your application performance on a real-time basis.
These are six of the best features that ELB has to offer. Next, we shall discuss how ELB can be beneficial to your applications.
Related Article: AWS Interview Questions and Answers for Freshers |
The ELB service offers the following benefits:
ELB performs a complete health check of the AWS instance before sending any incoming traffic to it. This ensures that even if a particular instance fails or is unhealthy, ELB will route the traffic to the remaining healthy instances in the same availability zone – or to a different availability zone.
Elastic load balancing can also balance the workload across a region and to different availability zones. This ensures the benefit of high availability for your applications.
Visit here to learn AWS Course in Hyderabad
By supporting applications that are within the Amazon VPC, ELB provides robust network security with built-in features like user authentication, security certificate management, and SSL/ TLS decryption. As the IT maintenance team, you can specify if you want an internal – or an Internet-accessed - load balancer.
With an internal load balancer, ELB allows you to configure your traffic through private IP addresses. Alternatively, you could also route traffic between multiple application tiers using a combination of internal and Internet-facing load balancers.
ELB is designed to handle a rapid surge in incoming traffic. With its automatic scaling feature, ELB allows the automatic handling of varying application workloads without any human intervention.
By configuring “Auto Scaling” conditions for an ELB with running EC2 instances, it can automatically create additional EC2 instances when these conditions are fulfilled. You can set up conditions to create new instances in order to reduce latency. With automatic scaling, you can benefit from the adequate capacity for any application.
With Elastic load balancing, you can use different IP addresses to route your traffic requests to your target instance, thus making it more flexible. Besides, you can even virtualize your targets, thus enabling you to host many more applications in a single instance.
Thanks to its flexibility, you can now simplify the communication between applications by configuring them within the same security group and network port.
Thanks to its real-time integration with the Amazon CloudWatch tool, ELB allows you to perform real-time monitoring of all your web applications and their performance. This enables better visibility into how your applications are performing. Additionally, application monitoring enables you to detect performance bottlenecks or any other issues.
ELB enables you to balance your load across the AWS platform and your in-premise resources at the same time using the same load balancer. This makes it easier for you to handle any failover as well as to migrate on-premise applications to the cloud platform.
Leave an Inquiry to learn AWS Course in Bangalore
You can create your Application load balancer using either of the following methods:
Here’s how you can create your application load balancer using the web-based interface of the AWS management console:
Here’s how you can create your application load balancer using the AWS CLI:
1. Create your application load balancer using the “create-load-balancer” command. You need to specify two subnets that belong to different availability zones. Here is a sample command:
aws elbv2 create-load-balancer --name my-load-balancer
--subnets subnet-12345789 subnet-23556790 --security-groups sg-12346789
The output of this command must include the Amazon Resource Name or ARN of the load balancer.
2. Create your target group for your load balancer using the “create-target-group” command. Specify the same VPC that you used for your EC2 instances. Here is a sample command:
aws elbv2 create-load-balancer --name my-load-balancer
--subnets subnet-12345789 subnet-23556790 --security-groups sg-12346789
Again, the output must include the ARN of the target group.
3. Next, register your instances with your target group using the “register-targets” command. Here is a sample command:
aws elbv2 create-load-balancer --name my-load-balancer
--subnets subnet-12345789 subnet-23556790 --security-groups sg-12346789
4. Next. create a listener for your load balancer using the “create-listener” command that includes a default rule. Here is a sample command:
aws elbv2 create-load-balancer --name my-load-balancer
--subnets subnet-12345789 subnet-23556790 --security-groups sg-12346789
--default-actions Type=forward,TargetGroupArn=targetgroup-arn
Again, the output must include the ARN of the listener.
You can create your Network load balancer using either of the following methods:
Here’s how you can create your network load balancer using the web-based interface of the AWS management console:
Here’s how you can create your network load balancer using the AWS CLI:
1. Create your network load balancer using the “create-load-balancer” command. You must specify one public subnet for each availability zone. Here is a sample command:
aws elbv2 create-load-balancer --name my-load-balancer --type network --subnets subnet-12345688
The output of this command must include the Amazon Resource Name or ARN of the load balancer.
2. Create your target group for your load balancer using the “create-target-group” command. Specify the same VPC that you used for your EC2 instances. Here is a sample command:
aws elbv2 create-load-balancer --name my-load-balancer --type network --subnets subnet-12345688
Again, the output must include the ARN of the target group.
3. Next, register your instances with your target group using the “register-targets” command. Here is a sample command:
aws elbv2 register-targets --target-group-arn targetgroup-arn --targets Id=i-12345789 Id=i-23556790
4. Next. create a listener for your load balancer using the “create-listener” command that includes a default rule. Here is a sample command:
aws elbv2 register-targets --target-group-arn targetgroup-arn --targets Id=i-12345789 Id=i-23556790
Again, the output must include the ARN of the listener.
5. Finally, for a network load balancer, you need to specify one elastic IP address for each subnet using subnet mapping. Here is a sample command:
aws elbv2 register-targets --target-group-arn targetgroup-arn --targets Id=i-12345789 Id=i-23556790
You can create your Classic load balancer by only using the AWS Management console.
Here’s how you can create your classic load balancer:
Explore AWS Sample Resumes! Download & Edit, Get Noticed by Top Employers! |
Conclusion
As seen in this article, Elastic Load Balancing is a proven mechanism for distributing application and web traffic requests across multiple targets or instances. ELB allows you to scale your varying workloads automatically. We have also seen the three types of load balancers used in ELB and how to create each one of them.
Hope you have found this article detailed and helpful for your learning. Feel free to leave behind your queries in the section below.
Name | Dates | |
---|---|---|
AWS Training | Oct 15 to Oct 30 | View Details |
AWS Training | Oct 19 to Nov 03 | View Details |
AWS Training | Oct 22 to Nov 06 | View Details |
AWS Training | Oct 26 to Nov 10 | View Details |
Prasanthi is an expert writer in MongoDB, and has written for various reputable online and print publications. At present, she is working for MindMajix, and writes content not only on MongoDB, but also on Sharepoint, Uipath, and AWS.