A system can look faster after an architecture change while becoming worse at handling busy periods: completed requests appear quick because the requests that waited, timed out, or were rejected disappear from the latency chart. My position is that a scalability change has not worked until it handles a stated arrival rate without hiding work or moving the queue somewhere less visible.
A scalability claim needs an overload rule before it needs a diagram
Use Scalable Software Architecture Patterns for Modern Systems as a menu of hypotheses, not as evidence that a pattern will improve your service. “Add a queue” is a design proposal. “At the same incoming request rate, the queue stays bounded and accepted requests finish within our deadline” is a claim you can test.
Start with one user action, such as loading an item page, and follow the work it creates. Write down what counts as an arrival, what counts as a completed response, and what counts as unfinished work. If a page request triggers a background job, an HTTP 200 response does not prove that job finished. If a request returns HTTP 429, count it as a deliberate rejection rather than a success or an unexplained error. These distinctions matter because a pattern can improve one chart simply by changing where work waits.
For a first experiment, choose a proposed load of 40 arrivals per second; that is a workload setting to adjust to your service, not a claim about its production traffic. Set a trial deadline of 800 milliseconds for accepted requests and an explicit limit on outstanding jobs. Record the arrival rate, acceptance rate, completion rate, p95 end-to-end latency, timeout rate, and queue depth together. The p95 alone is insufficient because it excludes requests that never completed.
Make the decision rule falsifiable. For example: at the selected arrival rate, accepted work must finish before its deadline, outstanding work must stop growing after warm-up, and rejected requests must receive a response the client understands. If your existing service cannot meet that rule, the baseline still has value: it shows what the change must beat. I would not declare success because average latency fell, since a growing queue can leave the average for completed requests looking healthy until the test ends.
I would use Are your architecture changes paying off Measure latency cost risk to challenge the scope of a result, but a latency-cost-risk total still needs an overload rule: it cannot tell you whether unfinished work is accumulating between samples.
A fixed-concurrency test can conceal the queue you meant to find
A common load test starts a fixed number of users, each of whom waits for a response before sending another request. That is a closed workload: when the server slows, the test sends less traffic. It can make an overloaded system appear stable precisely because it stops applying pressure. An arrival-rate test is a better fit for this question because it asks what happens when requests continue to arrive at the chosen pace.
This k6 script runs against a local endpoint by default. Save it as load.js and run it with k6 run load.js; set the URL environment variable to point it at a comparable staging endpoint instead.
import http from 'k6/http';
import { check } from 'k6';
export const options = {
scenarios: { steady: {
executor: 'constant-arrival-rate', rate: 40, timeUnit: '1s',
duration: '5m', preAllocatedVUs: 40, maxVUs: 120
} }
};
export default function () {
const r = http.get(__ENV.URL || 'http://localhost:8080/items');
check(r, { 'HTTP 200': x => x.status === 200 });
}
The rate, duration, and virtual-user limits are test settings, not results. In particular, the configured five-minute run may be too short to reveal a slow-growing queue; extend it if queue depth has not settled. Check k6’s dropped_iterations as well. If that metric rises, the load generator failed to start some planned requests, so the test did not apply the arrival rate it claims to represent. Increasing maxVUs may fix the generator, but only a rerun can establish that.
Keep the workload comparable before and after the change. Use the same endpoint, request mix, payload sizes, data volume, and cache state. A cache warmed in the second run but cold in the first can explain an apparent improvement without any architecture benefit. Run the generator outside the application host when possible, since competition for CPU can make both the server and the test driver behave differently from production.
Do not treat the script’s HTTP 200 check as a complete pass criterion. It is a quick way to expose responses that are not 200; inspect the response breakdown separately, especially if the design intentionally uses HTTP 429 under overload. Also watch client-side timeouts. A request that never receives a response must remain in your accounting, because dropping it from the latency sample would reward the least reliable behavior.
The useful trace shows where waiting moved
After a load run, ask a narrower question than “Did p95 improve?” Ask where each request spent its time and whether that location changed. OpenTelemetry spans can separate time in the HTTP handler, a queue consumer, a PostgreSQL call, and an outgoing HTTP call. Propagate W3C Trace Context’s traceparent across those boundaries so a request and its downstream work can be inspected together. Missing propagation matters because an incomplete trace may make queued work look as though it ended at the front door.
Pair traces with counters and gauges. Prometheus can collect incoming requests, completed requests, failures, and current queue depth; Grafana can display those series on the same time axis. Use a Prometheus histogram for end-to-end request duration if you need to compare p95 across instances, because per-instance percentile summaries cannot simply be averaged into a service-wide p95. Include rejected requests in a separate counter rather than folding them into latency.
Suppose an illustrative run records 42 completed requests per second against 45 arriving requests per second over a sustained interval. Those are example observed rates, not targets. The gap means unfinished work grows by roughly three requests per second unless requests are failing or being rejected elsewhere. A shorter handler trace does not cancel that arithmetic. Look for the missing work in queue depth, active workers, timeout counts, and downstream calls.
Use the instrumentation already appropriate to the suspected bottleneck. PostgreSQL’s pg_stat_activity can show sessions waiting on the database while application traces show apparently idle handlers. If Kubernetes Horizontal Pod Autoscaler (HPA) is involved, compare replica count and CPU utilization with queue depth; CPU alone may remain low when workers are blocked on a database connection. Sample traces help explain individual slow requests, but unsampled counters are better for proving how many requests arrived and how many finished.
Establish a recovery test as well as a peak-load test. After the arrival rate drops, does queue depth return to its starting range, or does old work continue to delay new requests? A system that survives a burst but cannot catch up has not gained usable capacity, because the next ordinary request inherits the backlog. Record the time at which load decreases and the time at which outstanding work returns to normal; that interval is often easier for a junior developer to verify than an argument about whether a chart “looks stable.”
Bounded work beats extra replicas when the downstream limit does not move
Compare two concrete options: bounded concurrency with a finite queue and HPA-driven replica scaling. Bounded concurrency wins when a shared dependency, such as PostgreSQL, is already saturated: it limits simultaneous calls and makes overload visible through waiting or explicit rejection. Its cost is a capacity limit you must choose, plus a policy for what happens when the queue fills. HPA wins when additional application replicas genuinely add capacity and the dependency can support them. Its costs include more compute and a delay before new replicas are ready; extra replicas can also increase pressure on an already-limited database.
For a trial of bounded work, choose a concurrency cap of 16 active database operations as an initial value to tune, not a universal setting. Then compare completed operations per second, database wait time, queue depth, and HTTP 429 responses at the same arrival rate as the baseline. If completion rate stays flat while database waits fall and rejections become prompt and predictable, the change improved overload behavior without increasing throughput. Say that plainly; calling it a throughput win would mislead the next person choosing a capacity plan.
For an HPA trial, record when the Kubernetes HPA requests replicas, when those pods become ready, and when completion rate changes. If replicas increase but completion rate does not, inspect the downstream limit before raising the maximum replica count. That conclusion follows from the measurement: more application workers did not produce more finished work. If completion rate rises without a growing queue or a sharp increase in failures, scaling the replicas has evidence in its favor, even if the bounded-queue design looked simpler on paper.
Check client behavior before declaring either option safe. A 429 response with a Retry-After header can tell an HTTP client when to retry, but immediate automatic retries can turn one arrival into several and invalidate the assumed load. Include the real client’s retry policy in a later test, and distinguish original requests from retry attempts in metrics. Otherwise, a server-side improvement may merely transfer overload to clients.
Your first step is to pick one endpoint and write its accounting rule before changing code: arrivals, completions, rejections, timeouts, and outstanding work must all have a place. Run a baseline at a stated arrival rate and save the graphs together. If you cannot reconcile those counts, fix the measurement first; an architecture change made now would be difficult to judge later.


