Code Monkey home page Code Monkey logo

Comments (10)

exagil avatar exagil commented on May 10, 2024 1

Has there been a decision on an algorithm for rolling window rate limiting yet?

from ratelimit.

mattklein123 avatar mattklein123 commented on May 10, 2024

Windowed limits are not currently supported.

from ratelimit.

andrascz avatar andrascz commented on May 10, 2024

Would you be interested in something like https://github.com/brandur/redis-cell?
This practically shifts the rate limit algorithm implementation from the service to Redis, but I think could be implemented with minimal effort.

from ratelimit.

mattklein123 avatar mattklein123 commented on May 10, 2024

@andrascz it might be interesting to support something like that, though I think to be useful we would need to support those commands with whatever sharding/cluster system is being used. A single redis host is not going to scale in most deployments.

from ratelimit.

andrascz avatar andrascz commented on May 10, 2024

I am not 100% sure as I did not try it on cluster, but based on brandur/redis-cell#30, either it is already working or needs minimal tweaks.

from ratelimit.

walbertus avatar walbertus commented on May 10, 2024

@mattklein123 If the redis-cell support sentinel and cluster setup, will envoyproxy/ratelimit use it? Or you are inclined toward internal code implementation?

from ratelimit.

mattklein123 avatar mattklein123 commented on May 10, 2024

@mattklein123 If the redis-cell support sentinel and cluster setup, will envoyproxy/ratelimit use it?

Can you describe more what you are proposing?

from ratelimit.

walbertus avatar walbertus commented on May 10, 2024

There are two possible approaches to support rolling window limits:

  1. Use redis-cell then create a new cache impl that uses redis-cell commands
  2. Implement rolling window limit logic in new cache impl with basic Redis commands

The first approach would create a dependency on redis-cell module and shifting implementation to Redis.
This is a tradeoff between creating dependency vs maintaining implementation, which approach does the maintainer prefer?

from ratelimit.

mattklein123 avatar mattklein123 commented on May 10, 2024

In general I think (2) is better, but I have no objection to having an option that requires redis-cell as long as it is opt-in.

from ratelimit.

ysawa0 avatar ysawa0 commented on May 10, 2024

I don't think there was a decision made to strictly use a certain algorithm. There was work being done in #243 and #193 to implement rolling window but it's gone stale unfortunately.

from ratelimit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.