GithubHelp home page GithubHelp logo

Comments (8)

rabbbit avatar rabbbit commented on June 25, 2024

Hi,

Would you elaborate on the use case for this? Do you have a project already, or is it a theoretical interest?

from ratelimit.

prathik avatar prathik commented on June 25, 2024

@rabbbit I am working on it and evaluating various rate limiters. This is inspired by https://github.com/Netflix/concurrency-limits and wanted to reuse any existing libraries if present.

from ratelimit.

xiaoyang-chen avatar xiaoyang-chen commented on June 25, 2024

Goal: To use this library with an adaptive rate limiter algorithm like Vegas or AIMD

Problem: Right now the library exposes no way to update the rates dynamically.

There are two ways to solve for this

  1. Create a new rate limiter every time I want to update limits
  2. Dynamically update the rate limit on the object

Would like feedback on which is the preferred approach. Or if there is any other way.

I read the go files in this repo, first way is the better way for this ratelimit, I think, because limit is not direct influence to this ratelimit

from ratelimit.

prathik avatar prathik commented on June 25, 2024

@rabbbit If we update the perRequest value in limiter_atomic.go:41 we should be able to dynamically change the rate. Can I go ahead and contribute? Or do you prefer that we stick to create a new ratelimit object when we want to change the rate?

from ratelimit.

rabbbit avatar rabbbit commented on June 25, 2024

It's not just perRequest. Since we also store slack, we'd need to update (or throw away?) the actual slack value. We'd also need to do it atomically, so there's extra complexity there.

Is creating a new limiter feasible? If so, that would be my preference.

from ratelimit.

prathik avatar prathik commented on June 25, 2024

@rabbbit sure, I don't see any concerns with it, at worst case scenario we'd be creating a new object every couple of seconds till we hit a stable point. You see any concerns with that?

from ratelimit.

prathik avatar prathik commented on June 25, 2024

@rabbbit BTW I'm implementing Vegas congestion control on top of this library.

from ratelimit.

rabbbit avatar rabbbit commented on June 25, 2024

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.