All Projects → romantomjak → Redis Ratelimit

romantomjak / Redis Ratelimit

Licence: mit
A fixed window rate limiter based on Redis

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Redis Ratelimit

Limitrr
Light NodeJS rate limiting and response delaying using Redis - including Express middleware.
Stars: ✭ 203 (+1253.33%)
Mutual labels:  rate-limiter, redis
rush
rush.readthedocs.io/en/latest/
Stars: ✭ 42 (+180%)
Mutual labels:  rate-limiting, rate-limiter
zlimiter
A toolkit for rate limite,support memory and redis
Stars: ✭ 17 (+13.33%)
Mutual labels:  rate-limiting, rate-limiter
Nginx Lua Redis Rate Measuring
A lua library to provide distributed rate measurement using nginx + redis, you can use it to do a throttling system within many nodes.
Stars: ✭ 109 (+626.67%)
Mutual labels:  rate-limiter, redis
Hammer
An Elixir rate-limiter with pluggable backends
Stars: ✭ 366 (+2340%)
Mutual labels:  rate-limiter, rate-limiting
Guzzle Advanced Throttle
A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get the response from cache when the rate limit is exceeded or always get a cached value to spare your rate limits. Using wildcards in host names is also supported.
Stars: ✭ 120 (+700%)
Mutual labels:  rate-limiter, rate-limiting
phalcon-throttler
Phalcon Throttler is a Rate Limiter for the PHP Phalcon Framework.
Stars: ✭ 19 (+26.67%)
Mutual labels:  rate-limiting, rate-limiter
Redis rate
Rate limiting for go-redis
Stars: ✭ 248 (+1553.33%)
Mutual labels:  redis, rate-limiting
kong-scalable-rate-limiter
Kong plugin for Rate Limiting at high throughputs.
Stars: ✭ 19 (+26.67%)
Mutual labels:  rate-limiting, rate-limiter
limitrr-php
Better PHP rate limiting using Redis.
Stars: ✭ 19 (+26.67%)
Mutual labels:  rate-limiting, rate-limiter
Bottleneck
Job scheduler and rate limiter, supports Clustering
Stars: ✭ 1,113 (+7320%)
Mutual labels:  rate-limiter, rate-limiting
Gubernator
High Performance Rate Limiting MicroService and Library
Stars: ✭ 609 (+3960%)
Mutual labels:  rate-limiter, rate-limiting
Bucket4j
Java rate limiting library based on token/leaky-bucket algorithm.
Stars: ✭ 1,025 (+6733.33%)
Mutual labels:  rate-limiter, rate-limiting
Portara
Portara directive is a rate limiter / throttler for GraphQL
Stars: ✭ 158 (+953.33%)
Mutual labels:  rate-limiter, redis
Exchange Rates
💱 Querying a rate-limited currency exchange API using Redis as a cache
Stars: ✭ 37 (+146.67%)
Mutual labels:  rate-limiter, redis
gentle-force
Brute-force, error and request rate limiting
Stars: ✭ 45 (+200%)
Mutual labels:  rate-limiting, rate-limiter
Speedbump
A Redis-backed rate limiter in Go
Stars: ✭ 107 (+613.33%)
Mutual labels:  redis, rate-limiting
Rate Limit
🚔 General purpose rate limiter implementation.
Stars: ✭ 193 (+1186.67%)
Mutual labels:  redis, rate-limiting
adaptive throttler
manages multiple throttlers with ability to ramp up and down
Stars: ✭ 31 (+106.67%)
Mutual labels:  rate-limiting, rate-limiter
Api Boot
“ ApiBoot”是为接口服务而生的,基于“ SpringBoot”完成扩展和自动配置,内部封装了一系列的开箱即用Starters。
Stars: ✭ 460 (+2966.67%)
Mutual labels:  rate-limiter, redis

redis-ratelimit

Travis Coveralls PyPI PyPI - Python Version

A fixed window rate limiter based on Redis


Installation

$ pip install redis-ratelimit

Example Usage

The library itself is framework agnostic, but let's assume you want to use it with Flask:

from flask import Flask, jsonify
from redis_ratelimit import ratelimit

app = Flask(__name__)

@app.route('/')
@ratelimit(rate='10/m', key='ccc')
@ratelimit(rate='2/s', key='ccc')
def index():
    return jsonify({'status': 'OK'})

This will allow a total of 10 requests in any given minute, but no faster than 2 requests a second.

Notes

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].