Statistically Optimal API Timeouts
summary
Claims a practical method: capture per-request timings in a proxy, fit a CDF with least squares regression, then solve a constrained optimization with Lagrange multipliers (or a discrete knapsack approximation) using an open source Ruby Maxima library. Works for idempotent, independent retries and often outputs the simple equal-split policy, but fails for dependent retries. Also warns not to use Timeout::timeout for network timeouts and emphasizes dashboards and sufficient sample size before optimizing.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:50Inspiration
- 3:33Benefits
- 4:15Protocol Failure
- 5:18How to Use Timeouts
- 6:36How to Measure Timeouts
- 8:43Mathematical Formulation
- 13:49Gathering Data
- 14:55Analyzing Data
- 16:30Code
- 20:48Conclusion
related talks
29mPractical guide to benchmarking your optimizations
29mThe Less-Told Story of Socket Timeouts
28mTesting HTTP APIs in Ruby
33mI Made a Slow Thing Fast
43mReal World Ruby Performance at Scale
18mPerformance Optimization in Ruby
49mRuby HTTP Clients Comparison
33mEnsuring High Performance for Your Ruby App
