Elastic Load Balancing (ELB) is a critical AWS service that automatically distributes incoming application traffic across multiple targets, such as EC2 instances, containers, and IP addresses, across one or more Availability Zones. This distribution ensures high availability and fault tolerance forβ¦Elastic Load Balancing (ELB) is a critical AWS service that automatically distributes incoming application traffic across multiple targets, such as EC2 instances, containers, and IP addresses, across one or more Availability Zones. This distribution ensures high availability and fault tolerance for your applications.
ELB offers three types of load balancers:
1. Application Load Balancer (ALB): Operates at Layer 7 (HTTP/HTTPS) and is ideal for advanced routing decisions based on content. It supports path-based and host-based routing, making it perfect for microservices and container-based applications.
2. Network Load Balancer (NLB): Operates at Layer 4 (TCP/UDP) and handles millions of requests per second with ultra-low latency. It is best suited for extreme performance requirements and static IP addresses.
3. Gateway Load Balancer (GWLB): Operates at Layer 3 and is designed for deploying, scaling, and managing third-party virtual appliances like firewalls and intrusion detection systems.
For reliability and business continuity, ELB provides several key features:
- Health Checks: ELB continuously monitors target health and routes traffic only to healthy instances, ensuring application availability.
- Cross-Zone Load Balancing: Distributes traffic evenly across all registered targets in all enabled Availability Zones.
- Auto Scaling Integration: Works seamlessly with Auto Scaling groups to add or remove capacity based on demand.
- SSL/TLS Termination: Offloads encryption and decryption tasks from your instances.
- Connection Draining: Allows in-flight requests to complete before deregistering instances.
SysOps Administrators should monitor ELB metrics through CloudWatch, including RequestCount, HealthyHostCount, UnHealthyHostCount, Latency, and HTTP error codes. Setting up appropriate alarms helps maintain system reliability. Access logs can be enabled for troubleshooting and compliance purposes. Understanding ELB configuration, target group management, and listener rules is essential for maintaining resilient architectures on AWS.
Elastic Load Balancing: Complete Guide for AWS SysOps Administrator Associate
Why Elastic Load Balancing is Important
Elastic Load Balancing (ELB) is a critical component of highly available and fault-tolerant architectures in AWS. It ensures that your applications can handle varying amounts of traffic by distributing incoming requests across multiple targets such as EC2 instances, containers, and IP addresses. For the SysOps Administrator exam, understanding ELB is essential because it directly relates to reliability and business continuity objectives.
What is Elastic Load Balancing?
Elastic Load Balancing is a managed load balancing service that automatically distributes incoming application traffic across multiple targets in one or more Availability Zones. AWS offers four types of load balancers:
1. Application Load Balancer (ALB) - Operates at Layer 7 (HTTP/HTTPS) - Supports path-based and host-based routing - Ideal for microservices and container-based applications - Supports WebSocket and HTTP/2
2. Network Load Balancer (NLB) - Operates at Layer 4 (TCP/UDP/TLS) - Capable of handling millions of requests per second with ultra-low latency - Supports static IP addresses and Elastic IPs - Best for extreme performance requirements
3. Gateway Load Balancer (GWLB) - Operates at Layer 3 (Network Layer) - Used for deploying third-party virtual appliances - Ideal for firewalls, intrusion detection systems, and deep packet inspection
4. Classic Load Balancer (CLB) - Legacy load balancer operating at both Layer 4 and Layer 7 - Not recommended for new applications
How Elastic Load Balancing Works
Core Components: - Listeners: Check for connection requests from clients using the protocol and port you configure - Target Groups: Route requests to registered targets using the specified protocol and port - Health Checks: Monitor the health of registered targets and only route traffic to healthy targets
Traffic Distribution: - ELB nodes are deployed in each enabled Availability Zone - Cross-zone load balancing distributes traffic evenly across all registered targets in all enabled AZs - Connection draining (deregistration delay) allows in-flight requests to complete before deregistering targets
Integration with Auto Scaling: - ELB works seamlessly with Auto Scaling groups - New instances are automatically registered with the load balancer - Terminated instances are automatically deregistered
Key Features for High Availability
- Multi-AZ Deployment: Deploy load balancers across multiple Availability Zones for fault tolerance - SSL/TLS Termination: Offload encryption/decryption work from your application servers - Sticky Sessions: Bind a user's session to a specific target for stateful applications - Access Logs: Capture detailed information about requests sent to your load balancer - CloudWatch Metrics: Monitor load balancer performance and set alarms
Exam Tips: Answering Questions on Elastic Load Balancing
1. Know When to Use Each Load Balancer Type: - Choose ALB when questions mention HTTP/HTTPS, path-based routing, or microservices - Choose NLB when questions emphasize extreme performance, static IPs, or TCP/UDP traffic - Choose GWLB when scenarios involve third-party security appliances
2. Understand Health Check Configuration: - Know the difference between healthy and unhealthy thresholds - Understand timeout settings and intervals - Remember that unhealthy targets do not receive traffic
3. Cross-Zone Load Balancing: - Enabled by default for ALB (cannot be turned off at target group level) - Disabled by default for NLB and CLB - Understand how this affects traffic distribution across AZs
4. Common Troubleshooting Scenarios: - 502 Bad Gateway: Target is not responding or returning malformed responses - 503 Service Unavailable: No registered targets or all targets are unhealthy - 504 Gateway Timeout: Target is not responding within the timeout period
5. Security Considerations: - Security groups control traffic to ALB and CLB - NLB does not have security groups; traffic flows through to target security groups - Remember to configure security groups to allow health check traffic
6. Sticky Sessions vs. Cross-Zone Load Balancing: - Understand that sticky sessions can cause uneven load distribution - Know when sticky sessions are appropriate (stateful applications)
7. Key Metrics to Monitor: - HealthyHostCount and UnHealthyHostCount - RequestCount and TargetResponseTime - HTTPCode_Target_4XX_Count and HTTPCode_Target_5XX_Count
Remember: When answering exam questions, focus on the specific requirements mentioned in the scenario. Look for keywords that indicate which load balancer type is most appropriate and consider both performance and cost optimization factors.