Application Load Balancer vs Network Load Balancer difference, at 2am

TL;DR
- For HTTP/HTTPS workloads the ALB is the lower-ops pick: path and host routing, WAF, and Cognito auth are native, and its health checks speak HTTP, so a wedged app reports
unhealthyinstead of a silent TCP connect that succeeds. - The NLB is not more expensive to run, it's more expensive to live with. Client-IP preservation, cross-zone load balancing off by default, and zero HTTP awareness turn every network change into a security-group exercise.
- Choose NLB only when you need static IPs, UDP, PrivateLink endpoints, or hundreds of thousands of concurrent flows. For a two-person team fronting an HTTP app, the decision is already made.
Where the difference shows up on a normal Tuesday
On an ALB, the daily work is application-shaped. You add a listener rule, point api.example.com/v2/* at a new target group, and the change is live in about 30 seconds. Rollback is deleting the rule. Nothing in the VPC changes.
On an NLB, the same task starts with a question: does the target's security group allow the client CIDR on the target port? Because NLB preserves the source IP by default, your app sees the real internet address, which means any IP allowlist in the app or the SG now has to enumerate the world instead of the load balancer's subnet. I've watched a "five-minute" deployment turn into a 40-minute debugging session because a partner firewall only whitelisted the ALB's old address range.
Health checks behave differently too. ALB health checks are HTTP by default — a 200 on /healthz means the app is actually serving. NLB defaults to TCP: the check passes as long as something accepts the connection on that port, even if the Java process behind it is returning 500s to every request. You find that out from customers, not from CloudWatch.
Check both quickly with the same command, because describe-target-health is the single most useful tool in either world:
aws elbv2 describe-target-health
--target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/api-tg/1a2b3c4d5e6f7890
--region us-east-1
--query 'TargetHealthDescriptions[].{id:Target.Id,port:Target.Port,state:TargetHealth.State,reason:TargetHealth.Reason}'
## Failure modes, and how long the fix actually takes
The ALB fails loudly and usually with a number. `HTTP/1.1 504 Gateway Timeout` with `Server: aws-alb` in the response headers almost always means the target took longer than the idle timeout — 60 seconds by default. We hit this on a report export endpoint that needed 90 seconds; the fix was raising the ALB idle timeout, but only after confirming via `TargetResponseTime` in CloudWatch that the backend really was slow and not deadlocked.
The other classic is sporadic 502s under low traffic. That's usually a keep-alive mismatch: the ALB holds idle connections for 60 seconds, the Node process closes them at 5, and the ALB occasionally writes to a socket the target already killed. Set the target's keep-alive above the LB's idle timeout and the 502s evaporate.
The NLB fails quietly and by AZ. Because cross-zone load balancing is off by default, each NLB node only sends traffic to targets in its own subnet. One bad target group in `us-east-1c` and a third of your capacity is gone while the aggregate error rate looks survivable. Enabling cross-zone fixes the balance but adds a per-GB inter-AZ data charge — a line item that shows up on the bill a month later, not on the dashboard that night.
Rough fix times from my own incidents: ALB misroutes are 5–15 minutes because you're editing rules in one place. NLB connectivity problems run 30–90 minutes because you're bisecting four layers (SG on target, SG on NLB, NACL, client allowlist) with no HTTP status code to guide you.
## The 2am case: two targets unhealthy in one AZ only
2026-09-14, 02:07. PagerDuty fired on `UnHealthyHostCount` for an NLB fronting a Java service on `m5.xlarge` instances across three AZs in `us-east-1`. Six targets, two unhealthy, both in `us-east-1c`.
`describe-target-health` gave us the whole story in one shot:
```json
{
"TargetHealthDescriptions": [
{
"Target": { "Id": "i-0a1b2c3d4e5f67890", "Port": 8080 },
"HealthCheckPort": "8080",
"TargetHealth": {
"State": "unhealthy",
"Reason": "Target.Timeout",
"Description": "Health checks failed"
}
}
]
}
Timeouts, not connection refusals — so packets were being dropped, not rejected. My first read was wrong: I assumed the app had crashed on those two hosts and started pulling logs. The app logs were clean.
The actual cause was a Terraform apply three days earlier that replaced the target security group. The new SG allowed `443` from `0.0.0.0/0` and `8080` from a single `/32` that someone had copied from the old ALB setup. With client IP preservation on, NLB health check probes arrive from the NLB node addresses *inside each subnet*, not from one stable address. The `/32` matched nothing.
We verified by curling the health endpoint from a bastion in `us-east-1c` — connection timed out — then adding the three subnet CIDRs (`10.0.1.0/24`, `10.0.2.0/24`, `10.0.3.0/24`) to port 8080. Health checks went green 40 seconds later, which matched the 30-second health check interval plus the two-check healthy threshold. Lesson: on NLB, allow the subnet range, not an address. And write that into the module, not into a wiki page nobody opens at 2am.
## Ops cost translation: LCU, NLCU and the cross-zone trap
Both load balancers bill an hourly charge plus capacity units. At idle in `us-east-1` the hourly piece for either one lands in the low-to-mid teens of dollars per month — the same order of magnitude, so cost is rarely the deciding factor. What differs is what burns units.
| Billing dimension | ALB (per LCU) | NLB (per NLCU) |
|---|---|---|
| New connections/flows per second | 25 | 800 |
| Active connections per minute | 3,000 | 100,000 |
| Processed bytes per hour | 1 GB | 1 GB |
| Rule evaluations per second | 1,000 | not applicable |
Read that table as a hint about workload shape. An ALB charges you for rules and requests, so a chatty API with 40 listener rules costs more than raw bytes would suggest. The ALB default quota of 100 rules per load balancer is generous, but teams that route by tenant hit it and then discover that quota increases are a support ticket, not a console slider.
An NLB charges for flows and bytes, which is cheap for long-lived connections (database proxies, MQTT, gRPC streaming) and expensive once you flip cross-zone on and start paying inter-AZ transfer. Confirm current rates on the pricing page for your region before you size anything — us-east-1 numbers do not travel.
## When not to use each one
Do not put an ALB in front of a workload that needs a fixed IP. ALB addresses rotate; if a partner's firewall needs an allowlist entry, you need Global Accelerator bolted on, which is a second product with a second bill and its own ops surface. Four partners in, that's real maintenance.
Do not put an NLB in front of an HTTP app just because it's "faster". You lose path routing, header rules, WAF, and HTTP health checks, and you gain a custom nginx layer to reimplement them. I've seen that architecture three times and it always ended with someone rebuilding ALB features badly.
Skip the load balancer entirely if you have a single-instance internal tool. Route 53 with a health check and an A record costs almost nothing and has one fewer component to page on.
## Picking by team capability
If your team is one or two people and the traffic is HTTP, take the ALB and stop reading. The failure modes come with HTTP status codes, the console makes sense at 2am, and WAF is one checkbox away from blocking a credential-stuffing run.
Take the NLB when the constraint is network-level: static EIPs for partner allowlists, UDP for game or DNS traffic, PrivateLink for exposing a service to another VPC, or connection volumes that start with "hundreds of thousands". In those cases the extra ops burden is the price of the requirement, and you should budget for it — terraform modules that encode the subnet-CIDR SG rules, plus a runbook for per-AZ health checks.
A middle path worth considering: NLB with a TLS listener in front of an ALB target group, which gives you static IPs and HTTP routing. It works, but you now own two load balancers, two sets of metrics, and cross-zone billing on both. For most SMB stacks that's more moving parts than the problem deserves.
One thing I'd flag either way: put the target group health check interval and threshold into your alerting story. The default 30s/3-unhealthy means about 90 seconds to detection, and nobody notices an idle-page gap until after the incident. If alert noise is what keeps breaking, the team at awsgood.com handles this kind of day-two monitoring setup for small stacks — worth a look if you're doing it alone.
## Sources
- [Elastic Load Balancing documentation](https://docs.aws.amazon.com/elasticloadbalancing/)
- [Application Load Balancer target group health checks](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html)
- [Network Load Balancer cross-zone load balancing](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancer-cross-zone-load-balancing.html)
- [Elastic Load Balancing pricing](https://aws.amazon.com/elasticloadbalancing/pricing/)
FAQ
What is the main difference between an Application Load Balancer and a Network Load Balancer?
An ALB works at layer 7: it parses HTTP/HTTPS, routes by host, path and headers, and supports WAF and built-in auth. An NLB works at layer 4: it forwards TCP, UDP or TLS by IP and port, preserves the client source IP, and can hold a static IP per Availability Zone. The ALB understands requests; the NLB understands packets.
Is a Network Load Balancer cheaper than an Application Load Balancer?
Not meaningfully. Both bill an hourly charge plus capacity units, and the idle hourly cost is similar in us-east-1. The NLB can be cheaper for long-lived connections because of its higher flow allowance per unit, but cross-zone load balancing (off by default) adds inter-AZ data charges once enabled. Check regional pricing before deciding on cost.
Why are my NLB target health checks failing when the ALB ones worked?
Almost always security groups. With client IP preservation, NLB health check probes reach the target from NLB node addresses inside the target's subnet, not from one stable load balancer address. If you copied a `/32` allowlist from an ALB setup, nothing matches. Allow the target subnet CIDR on the health check port instead.
Can I get a static IP address with an Application Load Balancer?
Not natively. ALB node addresses rotate as it scales. To get fixed addresses you either put a Network Load Balancer in front of the ALB as a target, or attach AWS Global Accelerator. Both add cost and another component to monitor, so only do it if a partner or client genuinely requires allowlisting a fixed IP.
Does an ALB or NLB support WebSockets and gRPC?
The ALB handles both WebSocket upgrades and gRPC (including HTTP/2 end-to-end) natively, which makes it the default for chat, streaming dashboards and service-to-service gRPC. An NLB will carry the TCP connection fine but has no protocol awareness, so no header routing, no per-route metrics, and no HTTP status codes in your logs.
Which load balancer should a small team pick first?
For HTTP or HTTPS traffic, the ALB. Its failure modes surface as HTTP status codes you can search, routing changes are single-place edits, and WAF plus auth are one configuration away. Reach for the NLB only when a hard requirement — static IPs, UDP, PrivateLink, or very high flow counts — forces it.
Leave a Reply