This content originally appeared on DEV Community and was authored by Wakeup Flower
Scenario
- Web app behind an Application Load Balancer (ALB).
- Some EC2 instances are overloaded (too many outstanding requests).
-
CloudWatch shows higher:
- Request count
- Response time
Requirement: Do not forward new requests to overloaded instances.
Key background:
ALBs support two main load-balancing algorithms:
- Round Robin (default) – evenly distributes requests, without considering instance load.
- Least Outstanding Requests (LOR) – sends new requests to the target with the fewest active (in-flight) requests, providing adaptive load distribution.
When some instances get slower (more outstanding requests), LOR automatically directs new traffic to the less busy instances.
Metric relevance
-
RequestCountPerTarget→ shows how many requests each target handled. -
ActiveConnectionCount→ number of open connections (relevant for HTTP keep-alives or WebSockets). -
TargetResponseTime→ average response time, good for observation but not for routing logic directly.
The ALB’s Least Outstanding Requests algorithm inherently considers the number of active requests per target—it doesn’t need CloudWatch metrics directly for routing. But among the given choices, the ones referencing ActiveConnectionCount and RequestCountPerTarget correctly describe load indicators.
Option analysis
| Option | Algorithm | Metrics | Notes |
|---|---|---|---|
| A | Round robin | RequestCountPerTarget + ActiveConnectionCount | ❌ Round robin ignores load; not suitable. |
| B | Least outstanding requests | RequestCountPerTarget + ActiveConnectionCount | ✅ Correct — uses LOR algorithm, which addresses overloaded instances. |
| C | Round robin | RequestCount + TargetResponseTime | ❌ Round robin still ignores load. |
| D | Least outstanding requests | RequestCount + TargetResponseTime | ❌ “TargetResponseTime” not used by the ALB algorithm; LOR uses outstanding request count. |
Why:
- The Least Outstanding Requests algorithm automatically avoids sending new requests to busy instances.
- Metrics like
RequestCountPerTargetandActiveConnectionCountconfirm the balancing effectiveness, but the ALB handles this logic internally.
This content originally appeared on DEV Community and was authored by Wakeup Flower
Wakeup Flower | Sciencx (2025-10-13T12:37:14+00:00) 2 LB algorithms Round Robin & Least Outstanding Requests. Retrieved from https://www.scien.cx/2025/10/13/2-lb-algorithms-round-robin-least-outstanding-requests/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.