Is there a way to make this rate limiter use rolling window instead of fixed window algorithm? #126
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @caveen1999, There is no easy way to do that. However, if you are curious, there is interesting way to implement it using |
Beta Was this translation helpful? Give feedback.
Hi @caveen1999,
There is no easy way to do that.
However, if you are curious, there is interesting way to implement it using
rate-limiter-flexible
. Actions may consume points by key${ip}-${unixtimeSeconds}
with expiration equals to rolling window duration, e.g. 10 seconds. Every moment, consumed points for last 10 seconds can be got from store and summarised to allow or prohibit an action.This would be much slower than rolling-rate-limiter though.