rate-limiter

Design and implement token bucket rate limiters for API systems.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/hung-phan/system-skills --skill rate-limiter-hung-phan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-limiter
Source: https://github.com/hung-phan/system-skills/tree/main/skills/system-review/references/interview-templates/rate-limiter
Command: npx skills add https://github.com/hung-phan/system-skills --skill rate-limiter-hung-phan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires redis, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you design and implement rate limiters for APIs and tenant systems, ensuring fairness and preventing traffic spikes that can degrade service quality.

Core Features & Use Cases

  • API Traffic Management: Controls the number of requests an API can receive, protecting against abuse and traffic spikes.
  • Fairness and Admission Control: Ensures that resources are distributed fairly among users and tenants.
  • Use Case: When a high-traffic event, such as a promotion or a sale, occurs, this Skill can prevent a single user or tenant from overwhelming the system, maintaining service availability for all users.

Quick Start

Use the rate-limiter skill to implement a token bucket rate limiter for your API.

Frequently Asked Questions about rate-limiter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement rate limiting to protect my API from traffic spikes?

Rate limiting protects APIs by controlling request volumes using algorithms like token bucket or leaky bucket to ensure service reliability during traffic spikes. This Skill designs these mechanisms to manage traffic and maintain fairness.

What is the difference between token bucket and sliding window rate limiting?

Token bucket rate limiting allows bursting up to a capacity limit, while sliding window provides smoother traffic control by tracking requests within a moving time frame. This Skill implements both algorithms alongside fixed window and leaky bucket approaches.

How do I set up distributed rate limiting with Redis for multiple API tenants?

Distributed rate limiting coordinates state across multiple instances using Redis to ensure consistent traffic control for API tenants. This Skill addresses distributed coordination algorithms to maintain fairness across concurrent requests.

Does this rate limiter implementation require Redis to manage concurrency and state?

Redis is required as a dependency to manage distributed state and concurrency control for the rate limiter. It enables coordinated traffic management across multiple API system instances.

When should I use a leaky bucket algorithm instead of a fixed window for API traffic control?

Use leaky bucket rate limiting when you need smooth, continuous API traffic flow, and fixed window when you need strict request counts per time period. This Skill helps design both to ensure admission control and fairness.