Good Friction:Back Pressure and Budgets at Over a Billion Runs a Week
summary
System runs over a billion workflow runs a week and a synchronized cron tick creates global stampedes, so a token bucket per tenant is implemented but initial defaults (shared refill tick, single-run pricing, stall-on-failure) fail. Refactor to accrue from last check so bursts bank capacity, add live-worker‑scaled concurrency caps (budget controls rate, caps control instantaneous concurrency), and introduce backpressure with refuse early, refuse fast, refuse out loud reason codes. Result: top‑of‑hour spikes shape predictably and complaints shift from fairness to capacity.
AI-written summary · about
chapters (14)
- 0:00Introduction and setup
- 0:21Problem with cron expressions
- 1:28Friction and its hidden costs
- 2:31Stampede at top of hour
- 3:35Budget policy and its flaws
- 4:40Fixing token refill timing
- 5:43Budgets vs concurrency
- 6:47Putting limits on everything
- 7:50Dynamic concurrency limits
- 8:31Back pressure and refusal rules
- 9:37Reason codes for refusals
- 10:41Results and improvements
- 11:43Three key takeaways
- 12:27Conclusion and friction benefits
