Knobs · adjust the inputs
Inject a DB event: a row lock serialises writes; a blocking CREATE INDEX stalls writes for 9 s; CONCURRENTLY builds without blocking but slows every query.
formulas · assumptions
Little's law: concurrency = throughput × latency
CPU ceiling = servers × workers / CPU time
pipe capacity = bandwidth × one-way delay (bytes in flight, both directions)
RTT floor = 2 × one-way delay
Request 4 KB, response 16 KB, 503 body 512 B. Host RAM = 80 MB + 220 MB per worker + 8 MB per busy thread, capped at 4 GB. DB RAM = 400 MB + 11 MB per connection + 4 MB per queued query. 45 % of queries are writes; DB time is jittered 0.35–2.05× the mean. One thread per worker holds the GVL at a time; a thread at the DB releases it.
Flow visualizer
N requests in flight
← swipe the scene sideways to pan →
Little's Law:
Concurrency = Throughput × Latency
— ≈ — × —