Giter Site home page Giter Site logo

Comments (8)

mcollina avatar mcollina commented on May 17, 2024 3

I think we can have this as an option.

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

How would you do this? Having a sleep as a hook? We should also monitor the size of the sleeping queue otherwise we will face too many stalling requests. Don't you think so?

Exactly all of that. It's not "easy" and a solution that I would implement in my servers, however it's something that somebody might want to add.

In other terms: it is useful if you want to rate limit for business purposes but not protecting against attacks.

from fastify-rate-limit.

Eomm avatar Eomm commented on May 17, 2024 1

This feature assumes that the client calls sequentially the server, moreover, the client must be configured to don't rise a timeout on its side and the net stuff in the middle (proxies, firewall etc..) must be configured to don't cut the starving HTTP connection and raise up (by default nginx has a 60 seconds timeout)
This requires comprehensive documentation to avoid issues about these topics.

from fastify-rate-limit.

 avatar commented on May 17, 2024 1

I made the first version of fastify plugin to slow down the responses.
You can check it here

from fastify-rate-limit.

mcollina avatar mcollina commented on May 17, 2024

I think we can have this as an option.
Would you like to send a Pull Request to address this issue? Remember to add unit tests.

from fastify-rate-limit.

zekth avatar zekth commented on May 17, 2024

I think we can have this as an option.
Would you like to send a Pull Request to address this issue? Remember to add unit tests.

How would you do this? Having a sleep as a hook? We should also monitor the size of the sleeping queue otherwise we will face too many stalling requests. Don't you think so?

from fastify-rate-limit.

Beebeeoii avatar Beebeeoii commented on May 17, 2024

I think we can have this as an option.
Would you like to send a Pull Request to address this issue? Remember to add unit tests.

How would you do this? Having a sleep as a hook? We should also monitor the size of the sleeping queue otherwise we will face too many stalling requests. Don't you think so?

Yup agree that theres some complexities involved for this implementation. will see what i can come up with as this is a feature that i believe will help many

from fastify-rate-limit.

 avatar commented on May 17, 2024

There are two approaches: one is to implement the solution in this package, and the second is to create a new package just for this improvement.
I am working on implementing a new package.

from fastify-rate-limit.

Beebeeoii avatar Beebeeoii commented on May 17, 2024

hi thanks @CristiTeo for looking into this !

from fastify-rate-limit.

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.