[💡FEATURE REQUEST]: Rate-limit plugin
Is your feature request related to a problem? Please describe. A rate limitter for requests. I'm guessing it will be much faster than php middleware.
Describe the solution you'd like If it is possible i'd like to pass number of limit from the framework side(spiral), eg number of limit for specific user stored in database. If not, a simple limitter is still a nice-to-have thing.
Describe alternatives you've considered As alternative i've considered using php middlewares.
Additional context No context
Ideal scenario:
- Global rate limit would work natively on RR side
- Scoped rate limit could also work natively on RR side according to some matching rules (e.g certain headers)
- Custom rate limit that can call RR RPC from PHP (e.g calculate attributes for matching and then call RR for verdict)
We already have a community supported rate-limiter (aka circuit breaker): https://docs.roadrunner.dev/docs/community-plugins/circuit-breaker
It does not included in the RR bundle, but can be compiled with Velox. If someone want to take on supporting it, feel free to DM on Discord or here, I'll update permissions for the repository.
It’s not a rate limiter though. Like, totally different use case.
Yeah, it's not a rate-limiter. The point is, that such a small middleware is up to the community to build. So, if someone willing to build and support such a middleware, I would be glad to add it to the community plugins docs.
Understood, it makes sense. 👍 I just assumed that if a FR is not closed as 'wont-fix', then it's not unplanned. 😄