Quick revision
The short answer
A sharp knee between 300 and 400 requests per second while CPU sits at 50 percent means the bottleneck is not CPU but some queue or pool reaching its limit: database connections, request threads, a downstream service's capacity, or a lock. Queueing theory explains the shape, because as the utilisation of the bottleneck approaches 100 percent, waiting time grows very quickly rather than gradually. We confirm with pool metrics, thread dumps showing many threads waiting at the same place, BLOCKED threads for locks, and downstream latency, then fix that one resource and retest to find the next.
What to remember
In this answer, we saw that a sharp knee at moderate CPU means a pool, queue, downstream limit or lock is saturating, and queueing theory explains why waiting time explodes as its utilisation approaches 100 percent. Little's law turns pool sizes and holding times into capacity estimates, pool metrics and thread dumps with many threads parked or BLOCKED at the same place confirm the culprit, and we fix it by shortening holding time or adding capacity, then retest to find the next bottleneck.
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 sharp knee between 300 and 400 requests per second while CPU sits at 50 percent means the bottleneck is not CPU but some queue or pool reaching its limit: database connections, request threads, a downstream service's capacity, or a lock. Queueing theory explains the shape, because as the utilisation of the bottleneck approaches 100 percent, waiting time grows very quickly rather than gradually. We confirm with pool metrics, thread dumps showing many threads waiting at the same place, BLOCKED threads for locks, and downstream latency, then fix that one resource and retest to find the next.
Why this question is asked
Load tests often produce this graph: everything is fine up to some rate, and then a small increase makes latency explode and errors appear. Teams look at CPU, see plenty left, and are puzzled. Interviewers ask this because understanding the knee requires a bit of queueing theory and a disciplined way to find which resource is saturated. In this answer, we will explain why systems behave this way with numbers, use Little's law to find a likely limit, confirm it with metrics and thread dumps, look at the special case of locks, and finish with the fix-and-retest loop.
1Why Latency Has a Knee
Every request passes through resources with limited capacity: CPU cores, request threads, database connections, a downstream service, a lock. The one with the least spare capacity is the bottleneck. Its utilisation, the fraction of time it is busy, grows in proportion to traffic. But the time requests wait for it does not. A simple queueing model shows the waiting time growing with u divided by 1 minus u, where u is utilisation: at 50 percent busy, waiting equals one service time; at 90 percent, nine; at 99 percent, ninety-nine.
So a resource that is 75 percent busy at 300 requests per second is 100 percent busy at 400. Below that, queues are short and latency barely moves; near it, queues grow without limit, requests time out, timeouts cause retries, and retries add more load. That is the knee. CPU at 50 percent tells us only that CPU is not the bottleneck.
| Utilisation | Waiting factor u / (1 - u) | What users notice |
|---|---|---|
| 50 percent | 1 x service time | nothing |
| 75 percent (300 rps) | 3 x | slightly slower |
| 90 percent | 9 x | noticeably slower |
| 95 percent | 19 x | timeouts begin |
| 100 percent (400 rps) | unbounded | queue grows, errors, retries |
2Finding the Limit With Little's Law
Little's law says that the average number of requests inside a system equals the arrival rate times the average time each spends there. It lets us turn a pool size into a throughput limit. Suppose each request holds a database connection for 25 ms and the HikariCP pool has 10 connections. The pool can complete at most 10 / 0.025 = 400 requests per second. At 300 requests per second it is 75 percent busy; at 400 it is saturated. That matches the symptom exactly, and CPU can stay at 50 percent the whole time because the threads are waiting, not computing.
The same arithmetic applies to any pool or concurrency limit, so a quick table of each resource's capacity, from its size and the measured holding time, often points to the suspect before we look at a single graph.
3Confirming It With Pool Metrics and Thread Dumps
We confirm with metrics during a load test that crosses the knee. For the database pool, hikaricp.connections.active sits at the maximum while hikaricp.connections.pending climbs, and the acquire time grows. For request threads, tomcat.threads.busy reaches the maximum. For a downstream, its latency in http.client.requests rises, or its own metrics show saturation.
Thread dumps give the most direct evidence. We take two or three with jcmd a few seconds apart at the peak. If one resource is the bottleneck, many threads are waiting at the same line of code.
That count is the confirmation: 163 request threads are parked waiting for one of 10 connections. CPU is low because parked threads use none.
4When the Bottleneck Is a Lock
Sometimes the shared resource is a lock in our own code or a library: a synchronized method around a shared cache, a synchronized logger appender, or a static formatter guarded by a lock. Only one thread at a time can hold it, so its capacity is one divided by the time it is held. If each request holds it for 2.5 ms, the limit is 400 requests per second, the same knee.
In a thread dump, threads waiting for a synchronized monitor are in state BLOCKED with the line "waiting to lock" and the address of the monitor, and one thread shows "locked" with the same address. Many BLOCKED threads pointing to one monitor identify the lock.
5Fix the Bottleneck, Then Retest
Once we know the resource, we fix it, ideally by reducing how long each request holds it rather than only enlarging it. For the connection pool, that means faster queries, no remote calls inside transactions, and open-in-view turned off, so connections are held for 10 ms instead of 25, which by itself raises the limit to 1,000 requests per second. For a lock, it means a concurrent structure such as ConcurrentHashMap or a lock-free cache. For a downstream limit, it means caching, batching or negotiating capacity.
Then we run the load test again, because removing one bottleneck only reveals the next: maybe the downstream at 500 requests per second. We repeat until the knee is above the traffic we need with a margin, and we add alerts on the saturation signal we found, so production warns us before it reaches the knee.
- Load test past the kneerecord metrics and thread dumps
- Find the saturated resourcepending, busy = max, BLOCKED threads
- Reduce holding time or raise capacityshorter transactions, better locks
- Knee above target with margin?YesAdd saturation alerts, doneNoRetest to find the next bottleneck
4 steps in order. Play them, or step through them one at a time.
6Follow-up questions
Why do errors appear instead of just slower responses?
Because queues are bounded by timeouts. Requests waiting for a connection give up after connectionTimeout, callers time out and retry, and Tomcat's accept queue fills up so new connections are refused. Retries add load at the worst moment, which pushes the bottleneck further past saturation. That is why a small increase from 300 to 400 can turn into many errors.
Could the knee come from the load test tool itself?
Yes. A load generator with too few threads or connections, or a closed-model test that waits for each response before sending the next, can create its own limit or hide queueing. We check that the generator has spare capacity and prefer an open-model test with a fixed arrival rate, which reveals queueing the way real traffic does.
Would virtual threads remove the knee?
No. They remove the request-thread limit, but the connection pool, the downstream and the lock still have the same capacity. Requests would simply queue at the pool instead of at the thread pool.
7Conclusion
In this answer, we saw that a sharp knee at moderate CPU means a pool, queue, downstream limit or lock is saturating, and queueing theory explains why waiting time explodes as its utilisation approaches 100 percent. Little's law turns pool sizes and holding times into capacity estimates, pool metrics and thread dumps with many threads parked or BLOCKED at the same place confirm the culprit, and we fix it by shortening holding time or adding capacity, then retest to find the next bottleneck.
Open with
That pattern tells me the bottleneck is not CPU but some limited resource that has reached full utilisation: database connections, request threads, a downstream service's capacity, or a lock.
Then, if they want more
Queueing theory explains the shape. Waiting time grows roughly with utilisation divided by one minus utilisation, so a resource at 75 percent at 300 requests per second is at 100 percent at 400, and there queues grow without limit, timeouts fire, retries add load, and errors appear. CPU stays at 50 percent because waiting threads use no CPU.
I would first estimate capacities with Little's law. For example, a pool of 10 connections held for 25 ms per request supports at most 400 requests per second, which matches the knee. Then I would confirm during a load test past the knee: hikaricp.connections.active at the maximum with pending climbing, tomcat busy threads at the maximum, or rising downstream latency.
Thread dumps are the most direct evidence: if most request threads are parked in HikariPool.getConnection, or BLOCKED waiting to lock the same monitor, such as a synchronized cache or logger, that is the bottleneck.
To fix it, I prefer reducing how long each request holds the resource, like shorter transactions without remote calls inside or a concurrent cache instead of a synchronized one, over simply making it bigger.
Then I retest, because fixing one bottleneck exposes the next, and I add alerts on the saturation metric so production warns us before it hits the knee.
About this answer
- Last updated
- 12 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 "A Spring Boot service handles 300 requests per second fine but falls over at 400...": https://scrivio-interview-library.netlify.app/spring-boot/service-performance/0dfff5c52e/