The Limit You Didn't Set: Adaptive Concurrency Control
Every server needs a cap on how much work it will run at once, because unbounded concurrency does not degrade — it collapses. Let an arrival spike push more and more requests into flight with no ceiling and the queues grow, each request waits longer, memory balloons with half-finished work, the garbage collector starts stealing CPU to keep up, and the throughput you were trying to defend falls off a cliff exactly when you needed it most. This is the shape of a metastable failure: past a tipping point the overload sustains itself, and the only cure is to admit less work, not more.
The obvious defense is a fixed concurrency limit — "at most N requests in flight" — and it is almost always set to the wrong number. Too low and the server sits idle under its own cap on a quiet day, worker threads parked while capacity goes unused. Too high and the cap never engages until the system is already drowning. Worse, there is no single right number: the ideal limit drifts with the mix of cheap and expensive requests, with GC pauses, with a slow disk, with a noisy neighbor on the same host. A value that was correct at deploy time is wrong by lunch.
So the better servers stop asking an operator to guess. They discover the limit continuously, at runtime, from a signal the system produces for free — and the signal that works is latency, used exactly the way TCP congestion control has used it for decades: rising latency is the earliest honest evidence that you are sending more than the far end can absorb.
What you are actually controlling: Little's Law
The reason latency is the right signal falls straight out of Little's Law, the one piece of queueing theory every systems engineer should keep in their pocket: L = λ × W. The number of requests in flight (L, concurrency) equals the arrival rate (λ) times the time each one spends in the system (W, latency). Rearranged, it says the thing you are really capping — concurrency — is the product of how fast work arrives and how long it takes.
When a server is below its capacity, adding concurrency raises throughput and latency stays flat at its best-case floor: there is no queueing, so W is just service time. Past the server's capacity — the knee of the curve — adding concurrency buys no more throughput, because every core is already busy; all the extra L does is pile into queues, which inflates W. The entire goal of a concurrency limit is to park L right at that knee: as much in-flight work as the server can actually process, and not one request more.
The feedback loop: latency as the gradient
A server cannot see the knee directly, but it can feel its way to it. The trick is to keep a running estimate of the best-case latency — the minimum latency observed over some window, which is the latency with essentially no queueing — and compare it to the latency requests are currently seeing. The ratio of the two is a gradient that says whether there is room to grow:
// Latency-gradient concurrency limit (the AIMD-style control loop).
double gradient = Math.Min(1.0, baselineRtt / currentRtt); // 1.0 = no queueing
double allowance = Math.Sqrt(limit); // gentle probe upward
double next = limit * gradient + allowance; // shrink fast, grow slow
limit = Clamp(next, minLimit, maxLimit);
When current latency sits at the baseline, gradient is 1.0: there is no queueing, so the limit holds and the small allowance nudges it upward to probe for more headroom. When latency inflates — say it doubles — gradient drops to 0.5 and the limit is cut roughly in half, fast, because queueing has been detected and the server needs to drain. This is additive-increase / multiplicative-decrease, the same conservative shape TCP uses: grow cautiously when things look fine, back off hard at the first sign of congestion. Left running, the limit oscillates gently around the knee and tracks it as conditions change — a GC pause inflates latency and the limit dips; the pause ends and it recovers — with nobody having configured a number.
Why latency, and not CPU or errors
It is tempting to drive the limit from CPU utilization or error rate instead, and both are worse signals. CPU lies: a request waiting on a disk or a downstream call consumes almost no CPU while still holding a concurrency slot and still queueing behind others, so a disk-bound server can be at 20% CPU and completely saturated. Error rate is honest but far too late — by the time requests are failing, the collapse has already happened and you are reacting to the wreck rather than steering around it.
Latency inflation is the earliest trustworthy signal, because queueing shows up in W before it shows up anywhere else. The one discipline it demands is that the latency be measured honestly: you have to time every request from the moment it arrived, including the time it spent waiting to be admitted, or you fall straight into coordinated omission and your "latency" will look fine precisely when the queue is longest. The gradient is only as good as the baseline, so the baseline must be a true minimum over a rolling window — long enough to be stable, short enough to follow a legitimate regime change.
How it composes
An adaptive limit is admission control, and it only helps if exceeding it is cheap. When a new request would push concurrency past the current limit, the server must reject it immediately rather than let it queue — fast rejection is the whole point, converting a slow overload into a quick, bounded signal. That makes the limit a natural partner to bounded-queue backpressure: the limit decides how much to admit, and the bounded queue is where the overflow is shed. The rejections it emits are also exactly the failures a client's circuit breaker is watching for, so a server that has found its knee and sheds cleanly above it propagates a crisp "I am full" upstream instead of melting down — which is what stops the retry pile-on from tipping the whole system into a metastable spiral.
Wrap-up
A fixed concurrency limit is a guess that is wrong on quiet days and busy ones alike, because the right limit is the knee of the throughput curve and the knee moves. Little's Law says that knee is a bound on in-flight work, and latency is the signal that reveals it: measure best-case latency, watch how far current latency has inflated above it, and let a gradient loop grow the limit cautiously and cut it sharply so it parks at the knee on its own. Drive it from latency rather than CPU or errors, measure that latency from arrival so coordinated omission cannot hide the queue, and shed fast above the limit so it composes with backpressure and the circuit breaker. The limit you never have to set is the one that is actually right.