Rate Limit Calculator: Requests per Second, Bursts and Batch Time
By FindMySum · Last reviewed
A rate limit calculator turns a limit like "100 requests per minute" into the numbers you need when writing a client or planning a job: the rate per second, the gap to leave between requests, each worker's share, the biggest burst the service will accept, and how long a batch of calls will take. APIs, gateways and cloud services all publish limits in different units; converting them to one shape makes them easy to compare and to respect.
The basic conversion
A limit is a count over a window. Dividing one by the other gives a rate:
rate = limit ÷ window length
spacing = window length ÷ limit
The calculator opens at 100 requests per minute. That is 100 ÷ 60 = 1.67 requests per second, 6,000 per hour and 144,000 per day, and a client that sends one request every 0.6 seconds will never exceed it. If several workers share the limit, divide it between them: with four workers, each gets 25 per minute, one request every 2.4 seconds.
Three kinds of limiter
Services enforce limits in different ways, and the difference shows in how bursts are treated. The calculator lets you choose:
- Token bucket. Tokens drip into a bucket at the refill rate until it is full. Each request takes one. A full bucket allows a burst up to its size, after which requests go at the refill rate. It is the most common design for APIs, and it is what RFC 2697 describes for network traffic with a committed rate and a committed burst size.
- Fixed window. A counter resets at the start of each window, such as each clock minute. Simple and cheap, but a client can send the full limit at the end of one window and again at the start of the next, so twice the limit can pass in about one window.
- Sliding window. The limiter looks back over the last window from the current moment, so no span of one window length ever holds more than the limit. It is fairer than a fixed window at the cost of more bookkeeping.
How long a batch takes
When you need to make many calls, such as a backfill, a sync or a data export, the limit decides the minimum time.
With a token bucket starting full, the first requests up to the bucket size go immediately; the rest follow at the refill rate:
time = (requests − bucket size) ÷ rate
With the defaults, 10,000 requests at 100 per minute and a bucket of 100: (10,000 − 100) × 0.6 s = 5,940 seconds, 1 hour 39 minutes. With a fixed or sliding window, you can send a full window's worth at once, then wait for the next: the last of 10,000 requests goes in the hundredth window, which starts 99 minutes in. The chart shows the requests sent over time, a straight climb for a token bucket and a staircase for windows.
These are lower bounds. If the client sends one request at a time and waits for each response, the job can't run faster than the number of requests times the response time either, whichever is slower. Retries and failed calls also count against most limits.
Staying under the limit
A few habits keep clients out of trouble:
- Pace, don't burst. Spreading requests evenly at a little under the limit avoids filling the bucket and hitting the wall all at once.
- Leave headroom. Aim at 80 to 90% of the published rate. Your clock and the server's aren't aligned, and other processes may share the same key or IP address.
- Read the headers. Many APIs return the remaining allowance and the reset time with each response. Use them to slow down before the limit is reached.
- Back off on 429. When the server answers 429 Too Many Requests, wait. Honour a Retry-After header if there is one; otherwise use exponential backoff with jitter so that many clients don't retry at the same moment.
Setting limits for your own service
If you run the API, the same numbers help you choose. Start from what the back end can sustain, such as database queries per second, and divide by the number of clients you expect to be active at once to get a per-client rate. Then pick a bucket size that lets legitimate clients do a short burst, like loading a page that makes ten calls, without letting one client starve the rest. Publish the limits and return them in headers, and clients will follow them.
More questions
What is the difference between rate limiting and throttling?
The words are often used interchangeably. When a distinction is made, rate limiting refuses requests over the limit (usually with HTTP 429), while throttling slows them down, queueing or delaying them until they fit. A leaky bucket is the classic throttle: requests drain out at a fixed rate whatever rate they arrive at.
Do rate limits count failed requests?
Usually yes. Most services count every request that reaches the limiter, including ones that fail with errors and the 429 responses themselves. That is why retrying aggressively after hitting a limit makes things worse: the retries eat into the next window.
What do the RateLimit headers mean?
Many APIs report the limit in response headers so clients can pace themselves: the limit, the requests remaining in the current window, and when it resets. Names vary (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset); the IETF HTTPAPI working group is standardising RateLimit and RateLimit-Policy fields. Read the remaining count and slow down before it reaches zero.
How do I choose the bucket size for my own API?
Set the refill rate to the sustained load you can serve and the bucket size to the largest burst you can absorb without hurting other users. Equal to one window's limit is a common start. Large buckets are friendlier to clients that wake up and send a batch; small ones protect the back end.
Can I go faster by using more API keys?
Technically each key may have its own limit, but most terms of service forbid creating extra keys or accounts to get around limits. Ask the provider for a higher tier, cache responses you request often, or use bulk endpoints that return many records per call.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.