Token Bucket Simulation: Capacity, Refill Rate, Allowed & Denied
This lesson is part of the course
In this lesson
You simulate a token bucket with capacity 10 and a refill of 4 tokens per second for 12 seconds of traffic and measure how many requests it rejects.
Buy the course once for $9.99 to unlock every lesson and lab, the final exam and the certificate – lifetime access, no subscription.
Lessons in this course
- Requests per Second & per Minute vs the Limit: the Peak from the Logs Locked
- Token Bucket Simulation: Capacity, Refill Rate, Allowed & Denied Locked
- Fixed vs Sliding Window Counters: the Boundary Burst Locked
- Retries with Exponential Backoff & Jitter: the Delay Table Locked
- 429 Error Rate & Success After Retries Locked
- Quota Planning per Customer Tier: Included Calls, Overage & Peak Load Locked
- Batching & Caching: How Many Calls (and Dollars) They Save Locked
- API Cost per Customer & Pricing Tiers: Gross Margin (Chart) Locked