INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Explain which load balancer type fits a workload and trace ALB listeners, rules, target groups and targets while distinguishing EC2/Auto Scaling responsibilities.

Prerequisite

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

Choose by routing requirements rather than the service name
TypeTypical role and selection questionKeep this distinction
Application Load Balancer (ALB)HTTP/HTTPS routing using application information such as hostnames and pathsNot a general-purpose relay for arbitrary TCP applications
Network Load Balancer (NLB)Transport requirements, including supported TCP, TLS, UDP and QUIC configurationsNot configured with ALB HTTP path rules
Gateway Load Balancer (GWLB)Steer traffic through virtual appliances such as firewallsA different purpose from normal web-application ALB routing
Classic Load BalancerPrevious generation; relevant to existing deployments and migrationDo 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

Synthetic ALB architecture: a request goes to one target; this is not live health or performance data
Client
ALBHTTPS :443 listener
Application target groupEach request goes to one eligible targetTo target A or B within the group selected by the rule
  • 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.

Record different settings for each component
ComponentRoleSynthetic example
ListenerThe protocol/port receiving client connectionsHTTPS :443 with a suitable certificate
Rule / actionWhat to do when a request matchesForward /reports/* to the application group
Target groupA target set with type, protocol/port and health configurationRegistered EC2 instances; application traffic uses HTTP :8080
TargetA concrete destination that processes the requestThe application on EC2 A or B
Health checkProbe a configured path/port and evaluate matching success codesHTTP :8080 /health, separately from client requests

Worked request: how does /reports/summary reach an app?

  1. The client connects to the ALB’s DNS name. Check scheme, source connectivity and address-family requirements.
  2. The HTTPS :443 listener accepts the connection; review the certificate and frontend SG controls.
  3. Identify the listener rule matching /reports/summary and its action. It may redirect or return a fixed response instead of forwarding.
  4. Inspect the selected target group and its registrations. Target state and configuration determine distribution.
  5. 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.

The listener is HTTPS :443 and the target group uses HTTP :8080. Which application port and target-side permission should you check?
Read the answer and reason

Answer: 8080 at the target, plus the configured health-check port · The frontend listener and backend connection are different. This example needs port 8080, with appropriately scoped access from the ALB.

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.

Do not collapse distinct target states into one error
StateMeaning to investigateNext evidence
initialRegistration or initial probing is in progressRegistration timing and initial health requirements
healthyConfigured probe criteria are satisfiedCheck real URLs and functionality separately
unhealthyHealth probing failedReasons such as Timeout or ResponseCodeMismatch
unusedNot used for routingReasons such as NotInUse/InvalidState; compare registrations and enabled AZs
drainingDeregistration is in progressIn-flight completion and deregistration state

Choose an option to see the result and explanation.

The ALB probe is healthy, but /reports/summary returns an application 500. Which interpretation is correct?
Read the answer and reason

Answer: Probe health and the real request are separate; investigate the app too · Health describes the configured probe. Correlate the real operation, dependencies and application evidence for the affected request/time.

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.

  1. Select ALB/NLB or another type from protocols and routing requirements.
  2. Trace one request through its listener, rule/action, target group and target.
  3. Review placement, routes, application/health ports, traffic controls and each TLS segment.
  4. Check probe health, application results and Auto Scaling replacement decisions separately.
  5. Plan deregistration and in-flight requests during failures/updates, along with capacity and cost.

Check, then explain in your own words

  1. Explain ALB/NLB selection using workload requirements.
  2. List the checks for a 443 frontend and 8080 backend.
  3. 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.