Rate Limit Calculator
Enter your RPM limit and burst size to get the optimal token bucket configuration, per-worker delay, refill time, and ready-to-use code snippets for Express, Nginx, and Cloudflare Workers.
Configuration
Token Bucket Visualization
Code Snippets
Frequently Asked Questions
What is a token bucket algorithm?▼
A token bucket is the most common rate limiting algorithm. The bucket holds a maximum number of tokens (burst size). Tokens are added at a fixed rate (RPM / 60 = tokens/sec). Each request consumes one token. When the bucket is empty, requests are rejected or queued. This allows short bursts while enforcing a long-term rate limit.
What is the difference between RPM and RPS?▼
RPM (requests per minute) and RPS (requests per second) both measure API throughput. RPM = RPS × 60. Most rate limit docs use RPM (e.g., OpenAI: 10,000 RPM). When calculating delays between requests, convert to per-second: delay = 1000ms / RPS.
How do I avoid hitting rate limits with multiple workers?▼
Divide your RPM by the number of concurrent workers. Each worker should wait at least (60,000ms / RPM) × workers between requests. Use a shared queue or Redis-based rate limiter (e.g., bottleneck, p-throttle) so workers coordinate instead of each maintaining their own timer.
What is burst size and why does it matter?▼
Burst size is the maximum number of requests you can send instantly before the rate limit kicks in. For a 60 RPM limit with burst=10, you can send 10 requests immediately, then must wait ~1 second per additional request. Larger burst sizes are useful for handling traffic spikes without queuing.
What is the refill time for an empty token bucket?▼
If you fully exhaust a token bucket (burst size = N), the refill time is N × (60,000ms / RPM). For example, a 60 RPM limit with 10-token burst: refill = 10 × 1000ms = 10 seconds. The bucket is fully replenished after 10 seconds of no requests.
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →Premium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →You Might Also Need
nginx Config Generator
Generate production-ready nginx server blocks instantly. Supports static sites, reverse proxy (Node.js, API), PHP-FPM, and HTTPS redirects. Includes SSL/TLS, gzip, cache headers, security headers, and
Open free tool →
nginx Config Builder
Build nginx server blocks and location blocks with a visual form. Configure reverse proxy, static file serving, WebSocket, CORS, gzip, and security headers. Generates copy-ready nginx config snippets.
Open free tool →
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
More Free Tools
Related Articles
API Rate Limiting: Algorithms and Implementation Guide 2026
Complete guide to API rate limiting in 2026. Token Bucket, Leaky Bucket, Sliding Window algorithms with Node.js and Redis implementations, distributed rate limiting, 429 handling, and best practices.
API Rate Limiting: Strategies, Algorithms, and Free Tools
A complete guide to API rate limiting in 2025: Fixed Window, Sliding Window, Token Bucket, and Leaky Bucket algorithms explained, with implementation in Node.js, Python, and Go, Redis-based distributed limiting, and client-side backoff strategies.
Docker Compose 開發環境架設:前端、後端、資料庫一鍵啟動
用 Docker Compose 建立完整的本地開發環境,包含 React 前端、Node.js 後端、PostgreSQL 資料庫,一個指令啟動所有服務,告別「在我電腦上可以跑」的問題。
Nginx Configuration Guide for Web Developers 2026: Reverse Proxy, SSL & Performance
Master Nginx configuration in 2026. Complete guide covering reverse proxy setup, SSL/TLS with Let's Encrypt, gzip compression, caching, rate limiting, load balancing, and common gotchas.
Cloudflare Workers & Wrangler v4 Complete Guide 2026
Complete guide to Cloudflare Workers and Wrangler v4 in 2026. Learn wrangler.toml configuration, Workers vs Pages, KV/R2/D1 bindings, environment management, local development with miniflare, and production deployment pipelines.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →