performance · testing · ecowell · database · deployment · system-design
Good Queue Under Load: What We Measured, and What We Did Not
After building the queue gateway, the obvious question was: did it help? We ran a read-only mix of realistic endpoints against our UAT database with the backend limited to 50% of one CPU and 512 MB of memory, a deliberately small server, and stepped up the number of simulated users.

The results
| Users | Release 18 p50 | Release 18 p95 | Candidate p50 | Candidate p95 | Candidate errors |
|---|---|---|---|---|---|
| 10 | 150 ms | 2,100 ms | 1,120 ms | 6,823 ms | 0 / 85 |
| 20 | 2,100 ms | 6,900 ms | 1,444 ms | 5,709 ms | 0 / 172 |
| 30 | 1,900 ms | 7,200 ms | 1,711 ms | 5,200 ms | 0 / 435 |
| 50 | 3,400 ms | 18,000 ms | 2,449 ms | 11,364 ms | 14 / 267 (5.2%) |
Release 18 was the previous version, with no queue (its 50-user run had a 34% error rate).
Reading it honestly
Where it helped. At 20, 30 and 50 users the candidate has lower latency than the old release. At 50 users the old version failed a third of requests. The new one failed 5%, and those failures were fast, explicit 503 busy answers, not hung connections.
Where it did not. At 10 users the candidate was slower (p50 1,120 ms against 150 ms). The comparison runs also differ in setup, so we do not call this a clean win. We report it anyway. A gateway adds overhead, and at light load there is nothing to protect against.
The real finding was not the queue. Per-request database calls looked like this:
| Route | Calls per request |
|---|---|
| master performance | 26.6 |
| technician installations | 8.2 |
| installations | 7.0 |
| customer profile | 5.1 |
| tickets | 5.0 |
| bookings | 4.0 |
When one page costs 26 round trips, each tens of milliseconds away, no queue can save you. Batching barely fired (3 to 8% hit ratio), because real requests rarely ask for identical things at the same instant. The honest lesson: a queue controls the damage, but fewer calls per request is what actually buys speed.
What we did next
Targeted the heaviest routes: exact-query caching for authorised branch-filtered reads, invalidation on every write, safe sharing of the master-performance response between managers of the same branch, and a short coalescing window for identical reads.
What we did not measure
This matters more than the table:
- No Round 2 numbers exist. The caching changes were built and unit-tested, but we had no running candidate environment to load test, and our deployment guard correctly rejected pointing the candidate at the hosted database. We did not bypass the guard to get a nicer chart.
- These are reads only. Write throughput under load was not measured here.
- One small machine, one database, one run per step. Treat the shape of the curve as meaningful and the exact milliseconds as indicative.
Takeaways
- Publish the row where you lost (10 users). It makes the other rows believable.
- Count database calls per request before you tune anything else.
- Fast, explicit failure under overload beats slow, silent failure.
- If you could not measure it, write “not measured”. A blank is more useful than a guess.