loom-rate-limiting
SolidAPI rate limiting and quota management.
AI & Automation 54 stars
3 forks Updated today MIT
Install
Quality Score: 85/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Rate Limiting
## Overview
Control the request rate a client can make: protect from abuse, enforce fair usage, shed load. Two decisions dominate correctness: **which algorithm** (burst tolerance vs accuracy vs memory) and **how to make the counter atomic** in a distributed setting. Everything else is headers and policy.
## Algorithm Selection
| Algorithm | Burst behavior | Accuracy | Memory/key | Use when |
| --- | --- | --- | --- | --- |
| **Fixed window** | Allows 2× limit at window boundary | Poor | 1 counter | Cheap, coarse limits where boundary burst is acceptable |
| **Sliding window log** | Exact, no boundary burst | Exact | O(limit) timestamps | Low limits needing precision (e.g. 5 login attempts) |
| **Sliding window counter** | Smooths boundary, small over/under | ~99% | 2 counters | General-purpose distributed limiting (best default) |
| **Token bucket** | Allows configurable burst up to capacity | Rate-exact avg | 2 numbers (tokens, ts) | APIs that should tolerate bursts (most public APIs) |
| **Leaky bucket** | No burst; smooths to constant output | Shapes traffic | Queue | Protecting a fragile downstream at fixed throughput |
| **GCRA** | Burst = capacity, single value | Exact | 1 timestamp (TAT) | High-throughput distributed limiting; token-bucket equivalent, cheaper |
⚠ **Fixed-window boundary burst** is the classic footgun: with limit=100/min, a client can send 100 at 00:59.9 and 100 at 01:00.1 — 200 requests in ~0.2s while never violating either window...
Details
- Author
- cosmix
- Repository
- cosmix/loom
- Created
- 8 months ago
- Last Updated
- today
- Language
- Rust
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
rate-limiting
Implement rate limiting and throttling — token bucket, fixed window, sliding window, quotas, and retry headers. Use when setting up API rate limits, choosing a throttling algorithm, or responding to abuse.
1 Updated 1 months ago
ecoma-io AI & Automation Listed
rate-limit-handling
Stay within a provider's limits and respond correctly when you exceed them, without hammering or stalling. Use when calling any API at volume.
7 Updated 5 days ago
Amey-Thakur AI & Automation Listed
api-rate-limiting
Patterns for adding rate limiting to HTTP APIs
3 Updated today
openshard