Elastic Load Balancers
- They allows us to balance load between different servers.
- Types
- Application Load Balancer : Layer 7. support advanced request routing based on HTTP request characteristics like path, headers, etc.
- Network Load Balancer : Very High Performance, Layer 4, Most expensive. Support millions of request per second.
- Classic Load Balancer : Dumber Layer 7, Legacy. Also supports Layer 4. The only thing supported at Layer 7 is X-Forwarded-For and sticky sessions.
- ELB responds with HTTP 504 Gateway Timeout when the application does not respond.
- The DNS names for the load balancers are {LB-name}.{region}-elb.amazonaws.com
- The healthcheck statuses for instances behind LB can be InService or OutOfService.
- When a healtcheck for an instance fails, the load balancer stops sending traffic to that instance.
- When configuring ELB health checks, bear in mind that you may want to create a file like healthcheck.html or point the ping path of the health check to the main index file in application
- Remember the health check interval is how often a health check will occur
- Healthy/Unhealthy thresholds are how many times
either will check before marking the origin either healthy or unhealthy
- Health Check Interval: 10 seconds
- Unhealthy Threshold: 2
- Healthy Threshold: 3
- This means that if the health check interval occurs twice without success, then the source will be marked as unhealthy. This is 2 checks @ 10 seconds per check, so basically after 20 seconds the origin will be marked unhealthy
- Likewise, if the healthy threshold is marked at 3, then it would be 3 x health check interval or 10 seconds being 30 seconds. After 30 seconds with 3 consecutive success checks, the origin will be marked as healthy.
- Enable Cross-Zone Load Balancing will distribute load across all back-end instances, even if they exist in different AZ’s
- ELBs are NEVER given public IP Addresses, only a public DNS name
- ELBs can be In Service or Out of Service depending on health check results
- Charged by the hour and on a per GB basis of usage
- Must be configured with at least one listener
- A listener must be configured with a protocol and a port for front end (client to ELB connection), as well as a protocol and port for backed end (ELB to instances connection)
- ELBs support HTTP, HTTPS, TCP, and SSL (Secure TCP)
- ELBs support all ports (1-65535)
- ELBs do not support multiple SSL certificates
- Classic ELBs support the following ports:
- 25 (SMTP)
- 80 (HTTP)
- 443 (HTTPS)
- 465 (SMTPS)
- 587 (SMTPS)
- 1024-65535
ELB Error Messages
HTTP Error Codes:
- 200 – The request has succeeded
- 3xx – Redirection
- 4xx – Client Error (404 not found)
- 5xx – Server Error
Application Load Balancer Limit | Default Limit |
Load balancers per region: | 20 |
Target groups per region: | 50 |
Listeners per load balancer: | 10 |
Targets per load balancer: | 1000 |
Subnets per Availability Zone per load balancer: | 1 |
Security groups per load balancer: | 5 |
Rules per load balancer (excluding defaults: | 10 |
No. of times a target can be registered per LB: | 100 |
Load balancers per target group: | 1 |
Targets per target group : | 1000 |
Classic Load Balancer Limit | Default Limit |
Load balancers per region: | 20 |
Listeners per load balancer: | 100 |
Subnets per Availability Zone per load balancer: | 1 |
Security groups per load balancer: | 5 |
AWS Certified Solutions Architect Associate Free Practice TestTake a Quiz