Hard quotas vs burst limits
coreintermediateA hard quota caps total usage over a fixed period — for example, 10,000 API calls per day, or 1,000 VM-hours per month. A burst limit caps the instantaneous rate of usage — for example, no more than 50 requests per second, even if the daily quota has plenty of room left. These are two different questions ("how much in total" vs "how fast right now") and a real system typically enforces both on the same resource at once: you can be well under your monthly quota and still get throttled because you tried to do too much in one second.
Think of it as
A hard quota is like a monthly data plan on a phone — 20 GB for the month, and once it is gone it is gone until the plan resets. A burst limit is like the phone's hotspot speed cap — even on day one, with the full 20 GB untouched, the connection still will not exceed a fixed number of megabits per second at any given moment. A customer can hit either wall independently: run out of data by the 10th of the month (quota exhausted, rate irrelevant), or get a slow hotspot in the first minute of use (rate capped, total data barely touched).
What we're doing: Show a caller that is well under its monthly quota still getting throttled by the burst limit, and a separate caller hitting the opposite failure.
- 9
- The first 10 requests in that second succeed by draining the token bucket; the remaining 30 fail on the burst check even though the account has used almost none of its monthly quota.
- 19
- A second caller that never bursts can still exhaust the separate hard quota simply by sustaining steady traffic long enough — a completely different failure with a completely different fix (wait for reset / request a quota increase, not "slow down").
Why this works: The two callers fail for opposite reasons on the same account type, and the fix for one does nothing for the other — this is the concrete reason a design has to track and report on quota-remaining and burst-capacity-remaining as two separate signals, not one combined "limit."
Returning one generic "rate limited" error for both quota and burst failures
Wrong
Better
What you see: Client retry logic backs off for a second (correct for a burst limit) and immediately fails again, over and over, because the real problem was a monthly quota that will not reset for three more weeks — a generic error code gives the caller no way to distinguish "retry in 1 second" from "retry in 3 weeks."
Why: A burst limit and a hard quota fail for different reasons and recover on different timescales; collapsing them into one error code forces every caller to guess which one happened, which usually produces either wasteful tight-retry loops or overly conservative backoff that is unnecessary for the burst case.
- Hard quota
- "How much total, over this period?"
- Calls/day, VM-hours/month, storage GB
- Hitting it means: wait for reset or request an increase
- Burst limit
- "How fast, right now?"
- Requests/second, tokens/second
- Hitting it means: slow down, capacity returns in seconds
Hard quota vs burst limit on the same resource
Remember: Quota = total allowed over a period (resets on a schedule); burst limit = allowed rate right now (recovers continuously). Both commonly apply to the same resource at once — check both before deciding which one to raise.
See also: noisy neighbor problem

