Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple targets and virtual appliances in one or more Availability Zones (AZs).
-
Instances monitored by ELB are reported as;
InService
, orOutofService
-
Load Balancer Types
ALB
,NLB
,CLB
-
ALB | Application Load Balancer
- has
Listeners
,Rules
, andTarget Groups
to route traffic. - for
HTTP
andHTTPS
traffic (OS Layer 7) - can create advanced request routing, sending specified requests to specific web servers.
- (O) can attach a Web Application Firewall(WAF)
- (X) no WAF for NLB and CLB.
- has
-
NLB | Network Load Balancer
- uses
Listeners
andTarget Groups
to route traffic. - for
TCP
traffic (OS Layer 4) - can handling millions of requests per second, while maintaining ultra-low latencies.
- for extreme performance.
- handle sudden and volatile traffic patterns while using a single static IP address per Availability Zone.
- uses
-
CLB | Classic Load Balancer (legacy)
- uses
Listeners
and EC2 instances are directly registered as targets to CLB - HTTP/HTTPS (OS Layer 7), TCP (OS Layer 4)
- recommended to use ALB or NLB
- uses
-
-
-
provisioning
:
The load balancer is being set up. -
active
:
The load balancer is fully set up and ready to route traffic. -
active_imparied
:
The load balancer is routing traffic but does not have the resources it needs to scale. -
failed
:
The load balancer could not be set up.
-
-
Gateway has timed out
⇒ the application not responding within the idle timeout period.- Issue could be either at the Web Server layer or at the Database Layer.
-
X-Forwarded-For Header
:
If you need the IPv4 address of your end user- get the original IP of incoming traffic passing through ELB.
- helps you identify the IP address of a client when you use an HTTP or HTTPS load balancer.
-
Your Application Load Balancer periodically sends requests to its registered targets to test their status. These tests are called health checks.
- health check don't support WebSockets.
-
- enable your users to
stick to the same EC2 instance
. ⇒ Can be useful if you are storing information locally to that instance. - can be enabled for CLB or ALB and sessions are remembered via Cookie.
- enable your users to
-
Cross Zone Load Balancing
- enables you to load balance across multiple AZs.
-
Path Pattern
allow you to direct traffic to different EC2 instances based on the URL contained in the request.- Route based on path patterns in the request URLs.
- e.g.
/img/*/pics
- e.g.
- Route based on path patterns in the request URLs.