What the lab measured
These numbers come from the lab on my laptop, read from the summaries committed in bench/results when this page was built. Each figure is the median over the runs of the sessions that stood, with the range under it, and a difference smaller than the range isn't a difference. The live demo isn't measured here: it runs under CPU quotas on a shared server, so it shows behaviour, not speed.
Where they were taken
- 12th Gen Intel(R) Core(TM) i7-1270P, 16 logical processors, plugged in, in best performance mode.
- WSL2 and Docker Desktop with 16 CPUs and 7.8 GiB. The system under test on cores 0-11, the load generator on 12,13,14,15.
- Images, each recorded with its digest:
postgres:17.10-alpine,redis:8.10.2-alpine,grafana/k6:1.8.2,python:3.14.9-alpine,ghcr.io/shopify/toxiproxy:2.12.0,szechuan-lab-api,szechuan-lab-loadgen.
The commit floor, the fsyncs a second this disk can do, fell from about 500 to about 300 between 2026-11-05 and 2026-11-07. The one change on record in between is a restart of the WSL VM. Windows itself flushes about 300 a second on that disk, so either the disk got slower or the VM didn't pass every flush through before, and there is no reading from before to tell which. Every series below ran after the fall, and so did all of E0 but its first run, which is marked in its table. The older series stay in the repo but aren't put next to these: e1b, e1b-20k and e1b-naive ran at the old floor, and e1a ran at the new one but at an older commit and without redis and queue.
Capacity without the room
Each line at a constant purchase rate, stepped from 100 to 3,200 a second.
From bench/results/e1a-all at 97de3a2: 3 of 3 sessions stood. In those, 132 of 132 runs were used, besides 6 probe runs shown on their own.
Floors in the sessions that stood: 291 (279 to 292) fsyncs a second, SELECT 1 at 0.043 ms (0.043 ms to 0.044 ms) and the empty endpoint at 0.184 ms (0.178 ms to 0.19 ms), at p50.
| Approach | Connections | Sessions | Sustained | Ceiling | Probe |
|---|---|---|---|---|---|
update | 8 | 3 | 200 | 275266 to 276 | — |
update | 20 | 3 | 200 | 247246 to 249 | — |
update | 64 | 3 | 200 | 204 | — |
for_update | 20 | 3 | 100 | 216215 to 219 | — |
optimistic | 20 | 3 | 100under 100 in 1 | 10070 to 100 | — |
redis | 20 | 3 | 1,600 | 3,2213,212 to 3,279capped by the ladder | 3,4383,398 to 3,516offered 6,400, 3 single runs |
queue | 20 | 3 | 1,600 | 3,2003,196 to 3,215capped by the ladder | 3,9973,951 to 4,027offered 6,400, 3 single runs |
- Sustained: the highest rate it kept up with p99 under 100 ms, no errors and at least 95% of the offered rate achieved.
- Ceiling: the most purchases a second it achieved at any step. The ladder stops at 3,200, so where a line reached the top, its ceiling is the ladder's and not the line's.
- Probe: purchases a second achieved when offered 6,400, one run per session after the closing anchor, outside the ladder's rules, for the lines that reached the top.
The drop without the room, up to 10,000 buyers
1,000 units and a burst of buyers in one second, then a tail. Every approach, with naive there to show the checker catches an oversell.
From bench/results/e1b-all at 97de3a2: 3 of 4 sessions stood. In those, 69 of 69 runs were used.
- session 3 was sent back: its anchor's time to sell out fell 10.3% from e1b-all's first session.
4 attempts weren't counted
- Windows outside the VM averaged 16.1% of the machine, Windows outside the VM reached 31.5% of the machine
- the VM outside the lab reached 51.2 MB/s of IO
- the generator's schedule lag was 36.6 ms at p99, at or over the 20 ms limit
- the generator's schedule lag was 27.4 ms at p99, at or over the 20 ms limit
Floors in the sessions that stood: 277 (270 to 281) fsyncs a second, SELECT 1 at 0.044 ms (0.043 ms to 0.044 ms) and the empty endpoint at 0.187 ms (0.183 ms to 0.195 ms), at p50.
| Approach | Buyers | Runs | Sold out, ms | Hold p50, ms | Hold p99, ms | Sold-out answer p50, ms | Errors, % | Oversell | Unsold | Stuck | Earlier lost, % | Verdict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
naive | 2,500 | 3 | 5,0824,652 to 5,306 | 4,6304,615 to 4,850 | 9,9059,889 to 9,917 | — | 8.54.5 to 8.6 | 1,1781,132 to 1,299 | — | — | — | 3 of 3 |
naive | 5,000 | 3 | 4,8094,690 to 4,904 | 5,4105,321 to 5,561 | 9,9069,902 to 9,912 | — | 27.226.9 to 27.3 | 2,1662,165 to 2,199 | — | — | — | 3 of 3 |
naive | 10,000 | 3 | 4,9404,857 to 5,026 | 7,0416,703 to 7,359 | 9,9339,923 to 9,943 | — | 51.150.9 to 53.3 | 2,7342,461 to 2,861 | — | — | — | 3 of 3 |
update | 2,500 | 3 | 4,1263,984 to 4,151 | 1,8391,792 to 1,901 | 3,8893,740 to 3,911 | 2.12.1 to 2.2 | 0 | 0 | 0 | 0 | 53.752 to 53.9 | 3 of 3 |
update | 5,000 | 3 | 4,2494,068 to 4,250 | 1,8961,852 to 2,022 | 4,0793,902 to 4,081 | 2.32.3 to 2.4 | 0 | 0 | 0 | 0 | 67.167 to 67.4 | 3 of 3 |
update | 10,000 | 3 | 4,0804,023 to 4,283 | 1,9761,928 to 2,043 | 3,9573,904 to 4,164 | 118.2 to 14 | 0 | 0 | 0 | 0 | 85.383 to 87.5 | 3 of 3 |
for_update | 2,500 | 3 | 4,8614,586 to 4,880 | 2,0952,093 to 2,147 | 4,6064,331 to 4,626 | 2.22.1 to 2.2 | 0 | 0 | 0 | 0 | 53.353.2 to 54.3 | 3 of 3 |
for_update | 5,000 | 3 | 4,7784,777 to 4,871 | 2,2922,141 to 2,377 | 4,6054,601 to 4,699 | 2.62.4 to 2.6 | 0 | 0 | 0 | 0 | 6766.4 to 67.6 | 3 of 3 |
for_update | 10,000 | 3 | 4,7124,594 to 4,871 | 2,7012,616 to 2,969 | 4,5814,453 to 4,743 | 2,4462,128 to 2,503 | 0 | 0 | 0 | 0 | 82.380.3 to 82.5 | 3 of 3 |
optimistic | 2,500 | 3 | never | 2,3112,212 to 3,050 | 9,8679,776 to 9,895 | — | 81.781.6 to 81.7 | 0 | 881881 to 891 | 0 | 62.961.9 to 65.5 | 3 of 3 |
optimistic | 5,000 | 3 | never | 1,6451,564 to 2,183 | 9,8909,793 to 9,919 | — | 87.7 | 0 | 863854 to 869 | 0 | 6967.4 to 70 | 3 of 3 |
optimistic | 10,000 | 3 | never | 3,3083,125 to 3,711 | 9,8079,781 to 9,940 | — | 90.390.2 to 93.1 | 0 | 876869 to 882 | 0 | 74.549.6 to 75.5 | 3 of 3 |
redis | 2,500 | 3 | 598540 to 737 | 161136 to 299 | 401344 to 570 | 1.51.4 to 1.5 | 0 | 0 | 0 | 0 | 5352.6 to 53.3 | 3 of 3 |
redis | 5,000 | 3 | 537500 to 614 | 185175 to 214 | 428416 to 519 | 1.4 | 0 | 0 | 0 | 0 | 67.367 to 67.4 | 3 of 3 |
redis | 10,000 | 6 | 564560 to 594 | 230225 to 240 | 525519 to 563 | 1.41.4 to 1.5 | 0 | 0 | 0 | 0 | 87.386.5 to 88 | 6 of 6 |
redisunsampled twin | 10,000 | 6 | 557544 to 677 | 235222 to 284 | 529509 to 650 | 1.51.4 to 1.5 | 0 | 0 | 0 | 0 | 86.865.4 to 88.7 | 6 of 6 |
queue | 2,500 | 3 | 340336 to 340 | 121115 to 125 | 187186 to 196 | 3,0142,972 to 3,313 | 0 | 0 | 0 | 0 | 52.352 to 52.4 | 3 of 3 |
queue | 5,000 | 3 | 421314 to 432 | 237142 to 274 | 357224 to 359 | 4,0583,860 to 4,171 | 0 | 0 | 00 to 3 | 0 | 66.866.5 to 67.2 | 3 of 3 |
queue | 10,000 | 3 | 324323 to 354 | 203193 to 226 | 311310 to 330 | 4,7864,784 to 4,799 | 0 | 0 | 00 to 1 | 0 | 88.386.4 to 88.8 | 3 of 3 |
- Sold out: from the first scheduled buyer to the last unit taken.
- Hold p50 and p99: per request, over the requests answered with a hold, each timed from when it was scheduled to be sent to its answer.
- Sold-out answer p50: per request, over the requests answered sold out or ended, retries included, timed the same way. It is how fast the system says no, not how long a buyer waits for a final no, which is longer, since a buyer asks again after a sold-out answer that isn't final.
- Errors: the share of requests that failed or timed out.
- Oversell: the most units held or sold beyond the stock at any moment, from the checker's replay of the WAL.
- Unsold: units left when the drop ended. Stuck: units neither sold, held nor back in stock. Both count on the stock being whole, so neither applies to a run that oversold, and naive has neither.
- Earlier lost: of the winners, the share for whom some buyer who got nothing had arrived earlier.
- Verdict: runs where the checker said what the approach should get (clean, or an oversell for naive).
The unsampled twin is a redis run without the slot sampler, so its numbers show what the sampling costs.
The drop without the room, 20,000 buyers
The Postgres approaches at 20,000. redis and queue ran as probes only, since at 20,000 arrivals in a second the generator is past its ceiling of about 10,000 a second on four vCPUs, and their runs lagged over the 20 ms limit.
From bench/results/e1b-all-20k at 97de3a2: 5 of 7 sessions stood. In those, 30 of 30 runs were used, besides 10 probe runs shown on their own.
- session 3 was sent back: its anchor's time to sell out fell 10.2% from e1b-all's first session.
- session 5 was sent back: its anchor's time to sell out fell 11.2% from e1b-all's first session.
1 attempt wasn't counted
- the generator's schedule lag was 20.4 ms at p99, at or over the 20 ms limit
Floors in the sessions that stood: 287 (281 to 296) fsyncs a second, SELECT 1 at 0.042 ms (0.041 ms to 0.044 ms) and the empty endpoint at 0.187 ms (0.187 ms to 0.192 ms), at p50.
| Approach | Buyers | Runs | Sold out, ms | Hold p50, ms | Hold p99, ms | Sold-out answer p50, ms | Errors, % | Oversell | Unsold | Stuck | Earlier lost, % | Verdict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
naive | 20,000 | 5 | 4,9104,732 to 4,959 | 7,9657,957 to 7,984 | 9,9599,955 to 9,960 | — | 85.184.7 to 85.2 | 1,7991,763 to 1,815 | — | — | 58.458 to 59.2 | 5 of 5 |
update | 20,000 | 5 | 4,2203,975 to 4,249 | 2,6102,535 to 2,644 | 4,3054,107 to 4,334 | 3,3663,096 to 3,473 | 0 | 0 | 0 | 0 | 8.57.8 to 9.3 | 5 of 5 |
for_update | 20,000 | 5 | 4,8944,694 to 4,927 | 8,0637,780 to 8,317 | 9,9709,966 to 9,980 | 7,5737,561 to 7,649 | 32.331.8 to 34.2 | 0 | 0 | 0 | 55.754.8 to 60.9 | 5 of 5 |
optimistic | 20,000 | 5 | never | 4,8664,729 to 5,052 | 9,9479,884 to 9,958 | — | 9493.6 to 94.1 | 0 | 899891 to 900 | 0 | 52.752.1 to 54.5 | 5 of 5 |
redisprobe, 0 of 5 usable | 20,000 | 5 | 508417 to 547 | 444377 to 483 | 724572 to 785 | 2.22 to 2.2 | 0 | 0 | 0 | 0 | 2.81.9 to 2.9 | 5 of 5 |
queueprobe, 0 of 5 usable | 20,000 | 5 | 317297 to 329 | 374349 to 395 | 537528 to 570 | 5,9655,881 to 6,274 | 0 | 0 | 31 to 19 | 0 | 0 | 5 of 5 |
A probe row is single runs, one per session after the closing anchor, never retried, and outside the series' median rule. Its figures come from runs the series didn't count, and the row says how many of them were usable.
Faults during the drop
10,000 buyers with a fault injected while they buy, compared with the same approach without it at the same commit.
From bench/results/e3 at 97de3a2: 3 of 3 sessions stood. In those, 81 of 81 runs were used.
2 attempts weren't counted
- the generator's schedule lag was 30.0 ms at p99, at or over the 20 ms limit
- Windows outside the VM reached 34.6% of the machine
Floors in the sessions that stood: 281 (280 to 294) fsyncs a second, SELECT 1 at 0.044 ms (0.041 ms to 0.045 ms) and the empty endpoint at 0.187 ms (0.185 ms to 0.188 ms), at p50.
| Approach | Fault | Runs | Sold out, ms | Without it, ms | Hold p99, ms | Without it, ms | Errors, % | Verdict |
|---|---|---|---|---|---|---|---|---|
update | an API instance killed | 3 | 4,4374,431 to 4,609 | 4,0804,023 to 4,283 | 4,3064,297 to 4,476 | 3,9573,904 to 4,164 | 0.3 | 3 of 3 |
update | the worker killed | 3 | 4,6194,512 to 4,638 | 4,0804,023 to 4,283 | 4,4954,394 to 4,516 | 3,9573,904 to 4,164 | 0 | 3 of 3 |
update | Postgres slowed by 5 ms each way | 3 | 3,9323,924 to 4,113 | 4,3114,197 to 4,320 | 3,8113,809 to 3,991 | 4,1884,070 to 4,201 | 0 | 3 of 3 |
for_update | an API instance killed | 3 | 5,0084,965 to 5,400 | 4,7124,594 to 4,871 | 9,4419,407 to 9,610 | 4,5814,453 to 4,743 | 3.33.1 to 4 | 3 of 3 |
for_update | the worker killed | 3 | 5,2175,177 to 5,597 | 4,7124,594 to 4,871 | 9,9515,325 to 9,969 | 4,5814,453 to 4,743 | 0.10 to 2 | 3 of 3 |
for_update | Postgres slowed by 5 ms each way | 3 | 14,57414,539 to 14,688 | 5,2785,073 to 5,395 | 9,9649,945 to 9,972 | 9,9569,939 to 9,960 | 15.313.5 to 15.7 | 3 of 3 |
optimistic | an API instance killed | 3 | never | never | 9,7419,681 to 9,815 | 9,8079,781 to 9,940 | 90.290.2 to 90.3 | 3 of 3 |
optimistic | the worker killed | 3 | never | never | 9,9579,895 to 9,978 | 9,8079,781 to 9,940 | 90.2 | 3 of 3 |
optimistic | Postgres slowed by 5 ms each way | 3 | never | never | 9,8319,783 to 9,861 | 9,9469,869 to 9,964 | 90.390.3 to 92.8 | 3 of 3 |
redis | an API instance killed | 3 | 2,6592,547 to 2,706 | 564560 to 594 | 1,9841,871 to 2,017 | 525519 to 563 | 0.3 | 3 of 3 |
redis | the worker killed | 3 | 566534 to 572 | 564560 to 594 | 536510 to 548 | 525519 to 563 | 0 | 3 of 3 |
redis | Postgres slowed by 5 ms each way | 3 | 798735 to 1,045 | 552545 to 651 | 1,014701 to 1,023 | 523521 to 609 | 0 | 3 of 3 |
redis | Redis restarted | 3 | 587569 to 595 | 564560 to 594 | 1,808530 to 1,995 | 525519 to 563 | 0 | 3 of 3 |
redis | Redis killed | 3 | 569549 to 593 | 564560 to 594 | 1,7191,607 to 1,731 | 525519 to 563 | 0 | 3 of 3 |
redis | Redis killed and its last writes cut | 3 | 572566 to 577 | 564560 to 594 | 1,7121,633 to 1,734 | 525519 to 563 | 0 | 3 of 3 |
redis | Redis wiped | 3 | 564532 to 605 | 564560 to 594 | 523492 to 1,801 | 525519 to 563 | 0 | 3 of 3 |
queue | an API instance killed | 3 | 337330 to 349 | 324323 to 354 | 359321 to 363 | 311310 to 330 | 5.63 to 6.3 | 3 of 3 |
queue | the worker killed | 3 | 329313 to 335 | 324323 to 354 | 295294 to 310 | 311310 to 330 | 0 | 3 of 3 |
queue | Postgres slowed by 5 ms each way | 3 | 560474 to 569 | 394364 to 455 | 550526 to 690 | 355317 to 451 | 0 | 3 of 3 |
- Without it: the same approach at 10,000 buyers with no fault, and for the slowed Postgres, through the same proxy with no delay.
- Hold p99: per request, as in the drop tables.
- Verdict: runs where the checker found nothing wrong after the fault.
Random faults, 200 runs
Each run drew an approach, a fault and the moment to inject it at random, from bench/results/campaign/2026-11-18 at 9744372. 0 of them ended with a wrong verdict. It judges verdicts, not speed, so it ran on the laptop in everyday use rather than emptied.
| Approach | Fault | Runs | Wrong | Where it landed | What came of it |
|---|---|---|---|---|---|
update | an API instance killed | 11 | 0 | in the sell-out 7, after the sell-out 4, while settling 0, after settling 0, never landed 0 | purchases in flight at the kill 11, buyers left without a final answer 0 |
update | the worker killed | 11 | 0 | in the sell-out 8, after the sell-out 11, while settling 0, after settling 0, never landed 0 | — |
update | Postgres slowed by 5 ms each way | 11 | 0 | in the sell-out 6, after the sell-out 5, while settling 0, after settling 0, never landed 0 | sold out inside the slowed window 6, sold out outside it 5, never sold out 0 |
for_update | an API instance killed | 11 | 0 | in the sell-out 2, after the sell-out 9, while settling 0, after settling 0, never landed 0 | purchases in flight at the kill 11, buyers left without a final answer 0 |
for_update | the worker killed | 11 | 0 | in the sell-out 7, after the sell-out 11, while settling 0, after settling 0, never landed 0 | — |
for_update | Postgres slowed by 5 ms each way | 11 | 0 | in the sell-out 5, after the sell-out 6, while settling 0, after settling 0, never landed 0 | sold out inside the slowed window 2, sold out outside it 9, never sold out 0 |
optimistic | an API instance killed | 11 | 0 | in the sell-out 11, after the sell-out 0, while settling 0, after settling 0, never landed 0 | purchases in flight at the kill 11, buyers left without a final answer 11 |
optimistic | the worker killed | 11 | 0 | in the sell-out 11, after the sell-out 0, while settling 0, after settling 0, never landed 0 | — |
optimistic | Postgres slowed by 5 ms each way | 11 | 0 | in the sell-out 11, after the sell-out 0, while settling 0, after settling 0, never landed 0 | sold out inside the slowed window 0, sold out outside it 0, never sold out 11 |
redis | an API instance killed | 11 | 0 | in the sell-out 5, after the sell-out 6, while settling 0, after settling 0, never landed 0 | purchases in flight at the kill 10, buyers left without a final answer 0, orphans given back by the reconciler 0, orphans found held 0, no settle line 0 |
redis | the worker killed | 10 | 0 | in the sell-out 4, after the sell-out 10, while settling 0, after settling 0, never landed 0 | the keeper was in a statement 0, between statements 10, taken over before the restart 10, not taken over before the restart 0 |
redis | Postgres slowed by 5 ms each way | 10 | 0 | in the sell-out 5, after the sell-out 5, while settling 0, after settling 0, never landed 0 | sold out inside the slowed window 5, sold out outside it 5, never sold out 0 |
queue | an API instance killed | 10 | 0 | in the sell-out 2, after the sell-out 8, while settling 0, after settling 0, never landed 0 | purchases in flight at the kill 9, buyers left without a final answer 0 |
queue | the worker killed | 10 | 0 | in the sell-out 4, after the sell-out 10, while settling 0, after settling 0, never landed 0 | the keeper was in a statement 8, between statements 10, taken over before the restart 10, not taken over before the restart 0 |
queue | Postgres slowed by 5 ms each way | 10 | 0 | in the sell-out 5, after the sell-out 5, while settling 0, after settling 0, never landed 0 | sold out inside the slowed window 5, sold out outside it 5, never sold out 0 |
redis | Redis restarted | 10 | 0 | in the sell-out 4, after the sell-out 6, while settling 0, after settling 0, never landed 0 | orphans given back by the reconciler 0, orphans found held 1, no settle line 0, slot conflicts at settling 3 |
redis | Redis killed | 10 | 0 | in the sell-out 5, after the sell-out 5, while settling 0, after settling 0, never landed 0 | orphans given back by the reconciler 0, orphans found held 1, no settle line 0, slot conflicts at settling 0 |
redis | Redis killed and its last writes cut | 10 | 0 | in the sell-out 5, after the sell-out 5, while settling 0, after settling 0, never landed 0 | orphans given back by the reconciler 0, orphans found held 0, no settle line 0, slot conflicts at settling 4, the cut lost writes 6 |
redis | Redis wiped | 10 | 0 | in the sell-out 3, after the sell-out 7, while settling 0, after settling 0, never landed 0 | orphans given back by the reconciler 0, orphans found held 0, no settle line 0, slot conflicts at settling 0 |
- Where it landed: when the fault hit the drop.
- What came of it: the cases the campaign checks for that fault.
- Both count runs, once per case even when the worker, killed twice in a run, hit it both times. A case at 0 was never reached.
The lab checking itself
Before a series, the lab checks the laptop and its own tools, with nothing else running.
| Run | Commit | Passed | Planted loads | Generator | Pool lag p99, ms | Replica | Logical |
|---|---|---|---|---|---|---|---|
| 2026-10-31 e0-1at the old floor | f22f27b | yes | caught | agrees with k6 | 5.98,000 a second on 4 vCPUs | 510 | 508 |
| 2026-11-17 e0-2 | 97de3a2 | noWindows outside the VM averaged 13.9% of the machineWindows outside the VM averaged 13.5% of the machine | caught | agrees with k6 | 4.48,000 a second on 4 vCPUs | 271 | 269 |
| 2026-11-17 e0-3 | 97de3a2 | noWindows outside the VM averaged 13.1% of the machineWindows outside the VM averaged 12.3% of the machine | caught | differs from k6 | 4.28,000 a second on 4 vCPUs | 271 | 273 |
- Planted loads: an idle window the quiet rules let through, and three loads (CPU and IO in the VM, CPU in Windows) they have to catch.
- Generator: my load generator against k6 on the same schedule, with a planted stall it has to show.
- Pool lag p99: the worst schedule lag of the generator's connection pool at the rate the series send.
- Replica and logical: the reference cell's purchases a second with Postgres at
wal_levelreplica and logical, since the checker reads the logical WAL.
Still to be measured
- The drop with the waiting room in front: the same approaches, with the line's fairness and what the room costs the sell-out.
- Faults with the waiting room in front.
- Bots in a series: the share of the stock a bot fleet gets with the defenses and without them. The defenses were smoke-tested, and those numbers are in the design notes.
- The proof of work on a phone, which the three above wait for, since the simulated buyers solve it at a phone's speed.
- How late expiry is: how long after its deadline a hold goes back to stock, with the sweeper every 50, 200 and 1,000 ms.