Quick revision
The short answer
A new pod has zero outstanding requests, so least outstanding requests sends it a large share of traffic exactly when it is slowest: the JIT has not compiled hot code, and caches and connection pools are empty. Requests pile up, p99 climbs, the pod fails readiness and is removed, recovers, and the cycle repeats, so scale-out adds no capacity. We fix it with slow start on the balancer, warming the pod before it reports ready, readiness thresholds that tolerate warm-up, and scaling earlier.
What to remember
In this answer, we saw that least outstanding requests floods a new pod because it starts with zero requests while its JIT, caches and pools are cold, creating a loop of overload, failed readiness and removal that prevents scale-out from adding capacity. We fix it with slow start on the balancer, warm-up before readiness, readiness thresholds that tolerate warm-up, and scaling earlier so pods are warm before the peak.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A new pod has zero outstanding requests, so least outstanding requests sends it a large share of traffic exactly when it is slowest: the JIT has not compiled hot code, and caches and connection pools are empty. Requests pile up, p99 climbs, the pod fails readiness and is removed, recovers, and the cycle repeats, so scale-out adds no capacity. We fix it with slow start on the balancer, warming the pod before it reports ready, readiness thresholds that tolerate warm-up, and scaling earlier.
Why this question is asked
Least outstanding requests is usually a good algorithm, which makes this failure surprising: it is working exactly as designed and still hurting the service. The problem is an interaction between the algorithm's view of a new pod and the JVM's behaviour at startup. Interviewers ask it to see whether we can connect those two, and whether we know the standard remedies on both sides. In this answer, we will see why a new JVM is slow, why the algorithm prefers it, how the feedback loop forms, and then fix it with slow start, warm-up, readiness tuning and earlier scaling, with Spring Boot code for the warm-up.
1Why a New Pod Is Slow
A freshly started Spring Boot service is much slower than one that has been running for a while. The JVM starts by interpreting bytecode, and the JIT compiler only compiles hot methods to optimised machine code after they have run many times; until then, request handling can be several times slower. Hibernate, Jackson and Spring also do lazy initialisation on first use.
Caches are empty, so every request goes to the database or downstream services. Connection pools such as HikariCP may hold only their minimum connections and must open more under load, each with a TCP and TLS handshake. A pod that is fine at steady state can easily take ten times longer per request in its first minute.
2Why the Algorithm Prefers It
Least outstanding requests sends each request to the backend with the fewest requests in progress. A new pod starts with zero, while busy pods at peak have many. So the balancer sends the new pod a large burst at the very moment it is slowest. Its requests do not finish quickly, outstanding requests climb, latency rises into seconds, and its readiness probe, which may share threads or a pool with the overloaded handlers, starts timing out.
After a few failed probes, Kubernetes marks the pod not ready and the balancer removes it. Without traffic it finishes its backlog and recovers, passes readiness, is added back with zero outstanding requests, and the flood starts again. The pod never warms up under a gentle load, and the extra capacity we scaled for never arrives.
- New pod becomes ready with 0 outstanding requests
- Balancer prefers it heavilyleast outstanding requests
- Cold JIT, empty caches and pools: slow responsesp99 several seconds
- Readiness probe failspod removed from the balancer
- Pod recovers with no traffic and passes readinessback to the first step
5 steps in order. Play them, or step through them one at a time.
3Fix 1: Slow Start on the Balancer
Slow start makes the balancer ramp up a new backend's share of traffic gradually over a window, such as 30 to 120 seconds, instead of treating it as a full member immediately. Envoy supports it through a slow start configuration on its round robin and least request policies, HAProxy through the slowstart server option, and several cloud balancers through a slow start duration on the target group. Check your balancer and version for the exact setting.
Notice that slow start limits traffic but does not warm anything by itself; the pod still learns under live requests, just fewer of them. That is why it pairs well with warm-up inside the pod.
4Fix 2: Warm the Pod Before It Reports Ready
We can do the expensive first-time work before the balancer sends real traffic. In Spring Boot, readiness stays at REFUSING_TRAFFIC until the application runners have finished, so an ApplicationRunner is a natural place to run representative requests against the pod's own service methods several hundred times, load the hot cache entries, and open the connection pool to its normal size. The explicit events in the code make that intent visible.
Warm-up requests must have no side effects, so we use read-only calls or a dry-run mode, and we keep the startup probe generous enough to allow the extra time. HikariCP's minimumIdle can also be set close to the pool size so connections are open before traffic arrives.
5Fix 3: Readiness Thresholds and Earlier Scaling
Readiness should answer 'should this pod get traffic?', not react to a single slow response. A probe with failureThreshold of 1 and a short timeout removes a pod that is only warming. We give the probe a sensible timeout and require several consecutive failures, and keep the readiness endpoint cheap and independent of the request thread pool where possible.
Finally, scale earlier. If new pods start only when existing ones are at 90 percent, they arrive during the peak, at the worst moment. Scaling at a lower target, or on a schedule ahead of known peaks, gives new pods time to warm before they are needed.
| Fix | Addresses |
|---|---|
| Slow start (30 to 120 s ramp) | the flood of traffic to a zero-load pod |
| Warm-up before ready | cold JIT, empty caches and pools |
| Readiness thresholds | removing a pod that is only warming |
| Scale earlier or on schedule | new pods arriving at the peak |
6Follow-up questions
How would you measure whether warm-up requests actually help?
Compare the latency of a pod's first few minutes of real traffic with and without warm-up, for example p99 per pod by minutes since start, which we can tag in metrics. Watch readiness failures and pod removals after scale-out, and the time until a new pod's latency matches the fleet. A canary group with warm-up next to a group without it, during the same peak, gives the clearest comparison.
Would round robin avoid this?
It would avoid the extreme flood, since a new pod gets only an equal share, but even an equal share at peak can overwhelm a cold JVM, and round robin brings its own problems with uneven requests. Least outstanding requests plus slow start is usually the better combination.
Can we make the JVM start warm?
Partly. Class data sharing archives speed up class loading, and newer JDK work on ahead-of-time caching, from Project Leyden, can store loaded and linked classes and profiles from a training run, so check your JDK version. CRaC, where supported, restores a checkpointed, already-warm JVM. Native images start fast but trade off peak throughput.
7Conclusion
In this answer, we saw that least outstanding requests floods a new pod because it starts with zero requests while its JIT, caches and pools are cold, creating a loop of overload, failed readiness and removal that prevents scale-out from adding capacity. We fix it with slow start on the balancer, warm-up before readiness, readiness thresholds that tolerate warm-up, and scaling earlier so pods are warm before the peak.
Open with
Least outstanding requests sends each request to the backend with the fewest in progress, and a brand-new pod has zero, so the balancer floods it at exactly the moment it is slowest.
Then, if they want more
In a new JVM the JIT has not compiled the hot code, caches are empty and the connection pool is not filled, so responses take much longer.
Requests pile up, p99 goes to seconds, the readiness probe times out, the pod is removed, it recovers with no traffic, gets added back with zero requests, and the cycle repeats, so the scale-out never adds capacity. I would fix it on both sides.
On the balancer, enable slow start so a new pod's share ramps up over 30 to 120 seconds; Envoy, HAProxy and several cloud balancers support it.
In the pod, warm up before reporting ready: in Spring Boot, keep readiness at refusing traffic, run a few hundred representative read-only requests, preload the hot cache and open the pool, then switch to accepting traffic.
I would also make readiness tolerant of warm-up, with sensible timeouts and several failures required, and scale earlier or on a schedule so new pods are warm before the peak.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Why does the algorithm hurt new pods, and how do you fix it?": https://scrivio-interview-library.netlify.app/architecture/load-balancing-networking/f24270089f/