No coalescing vs request coalescing

Without coalescing, every reader that misses a key starts its own fill from the database. With request coalescing, one reader fills the key and the others wait. When a hot key expires at 5,000 reads/s, database CPU demand reaches 10 times capacity without it and passes the 70 percent limit with it.

Play the level

No coalescingTap or press Space to merge the misses

No coalescing · database reads after one expiry: 5,000

Request coalescingTap or press Space to merge the misses

Coalescing · database reads after one expiry: 1

Case 1

5,000 reads/s reach a cache. At 0:20 every reader asks for one expired key. Database CPU must stay below 70 percent and p99 below 150 ms.

Case 1
Measure Goal No coalescing Request coalescing
p99 latency under 150 ms 24 ms Pass 24 ms Pass
Error rate under 0.01% 0% Pass 0% Pass
CPU use under 70% 1,000% Fail 41% Pass
Monthly cost 8 USD/mo 8 USD/mo
HTTP/2SQLUsersRedis cache0.25 vCPU · 0.5 GBPostgres0.5 vCPU · 1 GB
HTTP/2SQLUsersRedis cache0.25 vCPU · 0.5 GBPostgres0.5 vCPU · 1 GB
No coalescing: misses a goal
HTTP/2SQLUsersRedis cache0.25 vCPU · 0.5 GBPostgres0.5 vCPU · 1 GB
HTTP/2SQLUsersRedis cache0.25 vCPU · 0.5 GBPostgres0.5 vCPU · 1 GB
Request coalescing: meets the goals