All Projects → RussellLuo → Slidingwindow

RussellLuo / Slidingwindow

Licence: mit
Golang implementation of Sliding Window Algorithm for distributed rate limiting.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Slidingwindow

Ring Ratelimit
Rate limiting middleware for Clojure Ring
Stars: ✭ 78 (-65.64%)
Mutual labels:  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 (-47.14%)
Mutual labels:  rate-limiting
Ratelimiter
C# rate limiting utility
Stars: ✭ 159 (-29.96%)
Mutual labels:  rate-limiting
Sentinel Cpp
C++ implementation of Sentinel
Stars: ✭ 91 (-59.91%)
Mutual labels:  rate-limiting
Sentinel Golang
Sentinel Go version (Reliability & Resilience)
Stars: ✭ 1,817 (+700.44%)
Mutual labels:  rate-limiting
Node Rate Limiter Flexible
Node.js rate limit requests by key with atomic increments in single process or distributed environment.
Stars: ✭ 1,950 (+759.03%)
Mutual labels:  rate-limiting
Nekobin
Elegant and open-source pastebin service
Stars: ✭ 61 (-73.13%)
Mutual labels:  rate-limiting
Rate Limit
🚔 General purpose rate limiter implementation.
Stars: ✭ 193 (-14.98%)
Mutual labels:  rate-limiting
Istio Workshop
In this workshop, you'll learn how to install and configure Istio, an open source framework for connecting, securing, and managing microservices, on Google Kubernetes Engine, Google’s hosted Kubernetes product. You will also deploy an Istio-enabled multi-service application
Stars: ✭ 120 (-47.14%)
Mutual labels:  rate-limiting
Nginxconfig.io
⚙️ NGINX config generator on steroids 💉
Stars: ✭ 14,983 (+6500.44%)
Mutual labels:  rate-limiting
Governor
A rate-limiting library for Rust (formerly ratelimit_meter)
Stars: ✭ 99 (-56.39%)
Mutual labels:  rate-limiting
Speedbump
A Redis-backed rate limiter in Go
Stars: ✭ 107 (-52.86%)
Mutual labels:  rate-limiting
Enroute
EnRoute Universal Gateway: Cloud Native API gateway with OpenAPI support and free L7 rate-limiting built on Envoy proxy
Stars: ✭ 126 (-44.49%)
Mutual labels:  rate-limiting
Redisratelimiter
Redis Based API Access Rate Limiter
Stars: ✭ 80 (-64.76%)
Mutual labels:  rate-limiting
Laravel Rate Limited Job Middleware
A job middleware to rate limit jobs
Stars: ✭ 166 (-26.87%)
Mutual labels:  rate-limiting
Webapithrottle
ASP.NET Web API rate limiter for IIS and Owin hosting
Stars: ✭ 1,180 (+419.82%)
Mutual labels:  rate-limiting
Play Guard
Play2 module for rate limiting, based on token bucket algorithm
Stars: ✭ 123 (-45.81%)
Mutual labels:  rate-limiting
Mvcthrottle
ASP.NET MVC Throttling filter
Stars: ✭ 211 (-7.05%)
Mutual labels:  rate-limiting
Fastify Rate Limit
A low overhead rate limiter for your routes
Stars: ✭ 179 (-21.15%)
Mutual labels:  rate-limiting
Aspnetcoreratelimit
ASP.NET Core rate limiting middleware
Stars: ✭ 2,199 (+868.72%)
Mutual labels:  rate-limiting

slidingwindow

Golang implementation of Sliding Window Algorithm for distributed rate limiting.

Installation

$ go get -u github.com/RussellLuo/slidingwindow

Design

slidingwindow is an implementation of the scalable rate limiting algorithm used by Kong.

Suppose we have a limiter that permits 100 events per minute, and now the time comes at the "75s" point, then the internal windows will be as below:

slidingwindow

In this situation, the limiter has permitted 12 events during the current window, which started 15 seconds ago, and 86 events during the entire previous window. Then the count approximation during the sliding window can be calculated like this:

count = 86 * ((60-15)/60) + 12
      = 86 * 0.75 + 12
      = 76.5 events

Test Utility

prom_reports

For details, see testutil.

Documentation

For usage and examples see the Godoc.

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].