Topic lessonTopic: Load balancing and troubleshooting
What is ELB? ALB vs NLB, listeners, targets and health checks
Elastic Load Balancing (ELB) is a family of AWS services that distribute incoming traffic across targets. ALB and NLB are types of load balancer, with a different role from EC2 Auto Scaling. Follow an HTTP application example to separate request reception, routing rules, targets, health checks and actual application responses.
Explain which load balancer type fits a workload and trace ALB listeners, rules, target groups and targets while distinguishing EC2/Auto Scaling responsibilities.
Know EC2, AZs, subnets, HTTP/HTTPS and security groups. A listener receives requests on a configured protocol/port; a target is a destination. This page uses a fixed teaching example and creates no resources.
Choose the type for application, transport or appliance traffic
| Type | Typical role and selection question | Keep this distinction |
|---|---|---|
| Application Load Balancer (ALB) | HTTP/HTTPS routing using application information such as hostnames and paths | Not a general-purpose relay for arbitrary TCP applications |
| Network Load Balancer (NLB) | Transport requirements, including supported TCP, TLS, UDP and QUIC configurations | Not configured with ALB HTTP path rules |
| Gateway Load Balancer (GWLB) | Steer traffic through virtual appliances such as firewalls | A different purpose from normal web-application ALB routing |
| Classic Load Balancer | Previous generation; relevant to existing deployments and migration | Do not omit current-generation alternatives in a new design |
Check supported protocols, target types, address families, placement and features for the selected type. For example, an NLB TCP listener can pass encrypted traffic to a target, while an ALB HTTPS listener terminates TLS at the load balancer. HTTPS alone does not mean ALB is the only option.
Trace ALB request reception to the selected target
- EC2 AAZ-A / app
- EC2 BAZ-B / app
Separate periodic requests: health checksThe ALB probes the configured path and port. This is separate from the client request path, not a processing step that every application request passes through.
| Component | Role | Synthetic example |
|---|---|---|
| Listener | The protocol/port receiving client connections | HTTPS :443 with a suitable certificate |
| Rule / action | What to do when a request matches | Forward /reports/* to the application group |
| Target group | A target set with type, protocol/port and health configuration | Registered EC2 instances; application traffic uses HTTP :8080 |
| Target | A concrete destination that processes the request | The application on EC2 A or B |
| Health check | Probe a configured path/port and evaluate matching success codes | HTTP :8080 /health, separately from client requests |
Worked request: how does /reports/summary reach an app?
- The client connects to the ALB’s DNS name. Check scheme, source connectivity and address-family requirements.
- The HTTPS :443 listener accepts the connection; review the certificate and frontend SG controls.
- Identify the listener rule matching /reports/summary and its action. It may redirect or return a fixed response instead of forwarding.
- Inspect the selected target group and its registrations. Target state and configuration determine distribution.
- The selected application receives HTTP :8080 and returns an application response. Record its HTTP result separately from ALB health status.
Choose an option to see the result and explanation.
Plan ALB placement and application access separately
For ordinary regional AZ deployment, select ALB subnets in at least two different AZs. The guide requires checking a /27 or larger subnet and at least eight free addresses in each subnet to support scaling. Local Zone and Outpost deployments have different conditions. Match application placement, enabled ALB zones and registered-target AZs.
An internet-facing ALB does not require every target EC2 instance to be directly public with its own public IPv4. Review ALB-to-application/health routing and target SG permissions, alongside frontend rules, ALB egress, NACLs and application listeners. Do not expose targets worldwide simply to obtain connectivity.
Healthy probes are not whole-application correctness
ALB checks the target group’s configured protocol, port, path and success criteria periodically. A successful /health does not prove /reports/summary or a dependent database works. Conversely, an incorrect probe path or blocked health port can fail independently of the intended application request. Inspect reason codes and configuration, not just the status label.
| State | Meaning to investigate | Next evidence |
|---|---|---|
| initial | Registration or initial probing is in progress | Registration timing and initial health requirements |
| healthy | Configured probe criteria are satisfied | Check real URLs and functionality separately |
| unhealthy | Health probing failed | Reasons such as Timeout or ResponseCodeMismatch |
| unused | Not used for routing | Reasons such as NotInUse/InvalidState; compare registrations and enabled AZs |
| draining | Deregistration is in progress | In-flight completion and deregistration state |
Choose an option to see the result and explanation.
Separate traffic distribution, capacity management and costs
ELB distributes traffic; EC2 Auto Scaling maintains or changes instance capacity. Attaching a target group to an Auto Scaling group can integrate registration and deregistration as instances launch/terminate. To use ELB health for replacement decisions, review the group’s enabled health-check sources and related settings. An ALB unhealthy result does not necessarily trigger immediate instance replacement.
Review type-specific running hours and capacity units separately from EC2, public IPv4 and applicable transfer charges. ALB LCUs are load-related billing units, not EC2 instance charges. Capacity reservations have additional conditions. This lesson provides no measured performance or monetary estimate.
- Select ALB/NLB or another type from protocols and routing requirements.
- Trace one request through its listener, rule/action, target group and target.
- Review placement, routes, application/health ports, traffic controls and each TLS segment.
- Check probe health, application results and Auto Scaling replacement decisions separately.
- Plan deregistration and in-flight requests during failures/updates, along with capacity and cost.
Check, then explain in your own words
- Explain ALB/NLB selection using workload requirements.
- List the checks for a 443 frontend and 8080 backend.
- Distinguish healthy probes, application success and Auto Scaling replacement.
Check your understanding: Does adding an ALB complete application resilience and correctness?
No. Review target placement, capacity, state, application behavior and data design together.
Distribution is one part of the architecture. Capacity, data sharing/recovery, probe criteria and real request success have distinct responsibilities and checks.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- What is Elastic Load Balancing?Checked:
Scope and conditionsCurrent ALB/NLB/GWLB families and previous-generation Classic; target distribution versus EC2/Auto Scaling responsibilities.
Used in this lessonChoose the type for application, transport or appliance traffic Separate traffic distribution, capacity management and costs
- Application Load BalancersChecked:
Scope and conditionsListeners, target groups, enabled zones, ordinary Region AZ subnet /27 and eight free address guidance, with Local Zone/Outpost exceptions.
Used in this lessonTrace ALB request reception to the selected target Worked request: how does /reports/summary reach an app? Plan ALB placement and application access separately
Scope and conditionsALB HTTP/HTTPS listeners, port, rules, TLS termination and distinction from NLB TCP passthrough.
Used in this lessonChoose the type for application, transport or appliance traffic Trace ALB request reception to the selected target Worked request: how does /reports/summary reach an app?
- What is a Network Load Balancer?Checked:
Scope and conditionsConnection/transport target distribution; current target-group protocols include TCP, UDP, TCP_UDP, TLS, QUIC and TCP_QUIC. Introductory examples are not an exhaustive protocol list.
Used in this lessonChoose the type for application, transport or appliance traffic
- What is a Gateway Load Balancer?Checked:
Scope and conditionsVirtual network-appliance distribution and Gateway Load Balancer endpoints, distinct from HTTP application routing.
Used in this lessonChoose the type for application, transport or appliance traffic
- Action types for listener rulesChecked:
Scope and conditionsForward versus redirect and fixed responses; a configured fixed response can return a 5xx without contacting a target. Weighted forwarding does not automatically fail over from an empty/all-unhealthy group to another healthy group.
Used in this lessonTrace ALB request reception to the selected target Worked request: how does /reports/summary reach an app?
Scope and conditionsPeriodic configured health requests, thresholds and all-unhealthy fail-open; not whole-application correctness.
Used in this lessonTrace ALB request reception to the selected target Healthy probes are not whole-application correctness
Scope and conditionsinitial/unhealthy/unused/draining states and reason codes, especially Target.NotInUse/InvalidState versus health-check failures.
Used in this lessonHealthy probes are not whole-application correctness
Scope and conditionsTarget registration, target SGs, draining and Auto Scaling integration. Target optimizer uses a target-side agent for concurrency/readiness; special conditions are not assumed on ordinary groups.
Used in this lessonWorked request: how does /reports/summary reach an app? Plan ALB placement and application access separately Healthy probes are not whole-application correctness Separate traffic distribution, capacity management and costs
Scope and conditionsALB-generated 503: empty/all-unused target groups or target optimizer no-ready-target condition; distinguish 502/504 and target-generated errors.
Used in this lessonHealthy probes are not whole-application correctness
Scope and conditionsCross-zone disabled with an empty enabled AZ can cause 503 on requests entering that AZ. Routing/health thresholds and draining differ from generic all-unhealthy fail-open.
Used in this lessonHealthy probes are not whole-application correctness
Scope and conditionsDefault EC2 checks, opt-in ELB/Lattice/EBS and configured EC2 application-status aggregation. Check scope rather than assuming application coverage.
Used in this lessonSeparate traffic distribution, capacity management and costs
Scope and conditionsInitialization grace and immediate unhealthy handling when EC2 leaves running state. No fixed time recommendation or blanket ignored-health claim.
Used in this lessonSeparate traffic distribution, capacity management and costs
- Network ACL rulesChecked:
Scope and conditionsDirection, protocol, port, peer CIDR and first matching rule in ascending order.
Used in this lessonPlan ALB placement and application access separately
- Elastic Load Balancing pricingChecked:
Scope and conditionsType-specific running hours and capacity units, reservations, transfer and public IPv4 charges; not a fixed quote or performance measurement.
Used in this lessonSeparate traffic distribution, capacity management and costs