Least response time is a dynamic load balancing algorithm that directs each new request to the backend server that currently shows the lowest measured response time, usually combined with the number of active connections. In load balancing, it belongs to the family of adaptive methods that react to real server behavior instead of distributing traffic by a fixed rotation or a hash.
The method assumes that a server which answers quickly has spare capacity, while a slow server is either busy, degraded or located further away. By favoring fast servers, least response time aims to minimize the latency users experience and to route traffic away from struggling nodes before they fail health checks.
How least response time selects a server
The load balancer keeps a running response time metric for every server in the pool and evaluates it at each scheduling decision. The metric is typically a moving average, often exponentially weighted, so recent measurements count more than old ones and a single slow request does not dominate the score.
What counts as response time differs between implementations. Some products measure time to first byte of the server reply, others measure the full request duration, and Layer 4 devices may only see TCP handshake time. Many implementations multiply or combine the latency figure with active connection counts, producing a score such as average response time × (active connections + 1), and choose the server with the lowest score.
The following table shows which response time signals are commonly used and what each one reveals.
| Signal | Measured at | What it reflects |
|---|---|---|
| TCP connect time | Layer 4 | Network distance and accept queue load |
| Time to first byte | Layer 7 | Application processing start |
| Full response time | Layer 7 | Total work including payload transfer |
| Health probe latency | Active check | Server state between real requests |
| Outstanding requests | Layer 7 | Queue depth as a latency proxy |
Variants and implementations
Least response time is not a single standardized algorithm, so the same name hides different formulas across products. Commercial application delivery controllers, such as F5 BIG-IP with its fastest and observed methods, and cloud or service mesh proxies each define their own scoring and smoothing rules.
| Variant | Selection rule | Typical context |
|---|---|---|
| Pure fastest | Lowest average latency only | Small pools with similar load |
| Latency × connections | Lowest combined score | General web traffic |
| Peak EWMA | Lowest decayed peak latency × load | Service meshes and RPC |
| Weighted response time | Score adjusted by server weight | Mixed hardware capacity |
| Two-choice sampling | Compare two random servers by latency | Large, distributed balancers |
The peak exponentially weighted moving average used in some RPC frameworks reacts quickly to latency increases and slowly to improvements, which makes it cautious about recovering servers. Sampling two random servers, in the style of the power of two choices, avoids the cost of scanning every server and reduces herd behavior when many balancers share the same view.
Least response time compared with other algorithms
Least response time differs from static methods because it uses feedback from the servers themselves. That feedback improves distribution when servers or requests vary, but it also adds measurement overhead and the risk of reacting to noise.
| Algorithm | Decision basis | Strength | Weakness |
|---|---|---|---|
| Round robin | Fixed rotation | Simple and predictable | Ignores server load |
| Weighted round robin | Rotation with static weights | Handles unequal capacity | Weights do not adapt |
| Least connections | Active connection count | Adapts to long sessions | Ignores per-request cost |
| Least response time | Measured latency and load | Tracks real performance | Sensitive to noisy metrics |
| IP hash | Client address hash | Session affinity | Uneven with skewed clients |
In practice, least connections and least response time often produce similar results for uniform traffic. The difference appears when request costs vary widely or when one server becomes slow without dropping connections, for example because of garbage collection pauses, disk contention or a degraded dependency.
When to choose least response time
Least response time is most useful when backend performance is uneven or changes over time. It suits heterogeneous server pools, multi-zone deployments with different network distances and services whose dependencies occasionally slow down.
| Situation | Recommended choice | Reason |
|---|---|---|
| Identical stateless servers | Round robin or least connections | Latency feedback adds little |
| Mixed hardware generations | Least response time | Faster nodes receive more work |
| Backends in several zones | Least response time with locality rules | Prefers nearby servers |
| Session-bound applications | Sticky session plus least response time | Affinity first, latency for new sessions |
| Very low traffic | Least connections | Too few samples for reliable averages |
Configuration should include a sensible smoothing window, a slow start period for new or recovered servers and active health checks. Without slow start, a freshly added server with no history may look fastest and receive a burst of traffic before its caches are warm.
Limitations and failure modes
The main weakness of least response time is that fast failures look attractive. A server that immediately returns errors, such as HTTP 500 or 503 responses, can show the lowest latency in the pool and draw even more traffic, a pattern sometimes called a black hole effect.
- Count errors separately or exclude them from the latency average.
- Combine with outlier detection that ejects servers with high error rates.
- Limit oscillation by smoothing scores, because balancers that all chase the same fast server can overload it in turn.
- Account for request mix, since a server that happened to receive cheap requests will appear faster than it really is.
Response time also mixes network latency and server processing time, so a nearby but busy server may beat a distant idle one. Where this matters, operators pair the algorithm with locality-aware routing or global server load balancing that handles geography separately.
Stripped to the essentials
Least response time is a way of deciding which server handles the next request. The load balancer keeps watching how fast each server answers and sends new work to the one that is currently quickest.
Think of a supermarket checkout. Instead of counting heads in each line, you watch which cashier is moving customers along fastest. The key idea is to follow real speed. One caution applies: a cashier may look fast only because they are turning customers away.
Where it is applied
An online retailer runs its product catalog service on twelve servers, eight of a newer generation and four older machines kept for extra capacity. With round robin, every server received the same share of requests, and the older machines regularly reached 95 percent CPU during evening peaks, pushing the 99th percentile page time above 900 ms.
The operations team switched the load balancer to least response time combined with active connections, with a 30-second slow start for servers returning to the pool and an error-rate ejection rule. The newer servers began receiving roughly twice as many requests as the older ones, matching their real capacity.
During the next sales campaign, 99th percentile latency stayed below 400 ms, and when one database replica slowed down, the servers that depended on it automatically received less traffic until the replica recovered.