brandur/redis-cell
FreeA Redis module that provides rate limiting in Redis as a single command.
FreeFree tier
About brandur/redis-cell
redis-cell is a Redis module that implements rate limiting using the Generic Cell Rate Algorithm (GCRA) as a single command (CL.THROTTLE). It provides a rolling time window without requiring a background drip process, making it efficient and accurate for cloud architectures. The module is language-agnostic and can be installed via precompiled binaries (Mac/Linux) or built from source with Rust. It is fast, taking roughly 0.1 ms per command. Note: the project is in 'best effort' maintenance mode and no longer actively developed.
Key Features
Implements the Generic Cell Rate Algorithm (GCRA) for rate limiting
Rolling time window without background drip process
Single CL.THROTTLE command for all rate limiting operations
Fast performance: roughly 0.1 ms per command
Precompiled binaries available for Mac and Linux
Open source and easily pluggable into cloud architectures
Pros & Cons
Pros
- Uses the sophisticated GCRA algorithm for accurate rate limiting
- No need for background drip processes
- Language-agnostic design works with any Redis client
- Fast and efficient with sub‑millisecond latency
- Simple installation via binaries or source build
Cons
- Project is in 'best effort' maintenance mode and no longer actively developed
- Requires Rust to build from source (if not using binaries)
- Binaries only available for Mac and Linux; other OS not supported
- Limited to rate limiting; no other Redis module features
Best For
Rate limit user accounts by unique identifierThrottle requests by origin IP addressLimit global actions across an entire systemReplace naive Redis-based rate limiting implementations
FAQ
What algorithm does redis-cell use?
It uses the Generic Cell Rate Algorithm (GCRA), which provides a rolling time window without needing a background drip process.
How do I install redis-cell?
You can download precompiled binaries for Mac or Linux, extract them, and load the shared library into Redis. Alternatively, clone the repository, build with Cargo, and load the resulting .dylib or .so file.
What is the CL.THROTTLE command syntax?
CL.THROTTLE key max_burst count per period period [quantity]. For example: CL.THROTTLE user123 15 30 60 1 applies 1 token to 'user123' with a max burst of 15 and 30 tokens per 60 seconds.
What token limit can I set?
You can configure any numeric limit for tokens per time period. The module does not impose built‑in boundaries.
Is redis-cell actively maintained?
The project is in 'best effort' maintenance mode. Basic issues and compatibility updates are handled, but no active development or new features are planned.