Comments (2)
Thanks @ItsReddi for using the package and for leaving your issue. I'm looking into reproducing the issue and will respond with a solution if we identify a bug.
I think at first glance, X-RateLimit-Limit
is supposed to remain at the upper limit of 600 while X-RateLimit-Remaining
is to tell you how many hits you have left in the bucket before hitting the 600 limit. So in your case 599 then 594. The retry-after
should be formatted X-RateLimit-Retry-After
and should only show up when you are rate limited. The X-RateLimit-Reset
I supposed to be the unix timestamp of when your timeout is reset.
Another issue might be your actual configuration and our explanation of multi-bucket usage. We've got some improved documentation we are working on posting which should help clarify issues like this. Give me a bit of time and we'll get this all sorted out for you.
If you need something more urgently reach out to [email protected].
from ratelimiter.
Thanks for your reply i could set up an reproduction repository / with a vscode .devcontainer if that would help.
More than this i am unsure if we both understood the same issue.
I see the following issue, with the above configuration:
Actual result not hitting the limit on /api/v1/tasks:
...
X-RateLimit-Limit: 600 <--- thats from the global bucket
X-RateLimit-Remaining: 599 <--- thats from the global bucket
...
Expected result not hitting the limit on /api/v1/tasks:
...
X-RateLimit-Limit: 5 <--- should be from the route bucket
X-RateLimit-Remaining: 4 <--- should be from the route bucket
...
Actual result hitting the limit on /api/v1/tasks: (while beeing throttled, after 5 requests)
Here comes a mixed response from both buckets.
...
X-RateLimit-Limit: 600 <--- thats from the global bucket
X-RateLimit-Remaining: 594 <--- thats from the global bucket
retry-after: 30 <--- thats from the route bucket
x-ratelimit-reset: 1695987256 <--- unsure, from where it is, did not calulate
...
Epected result hitting the limit on /api/v1/tasks: (while beeing throttled, after 5 requests)
...
X-RateLimit-Limit: 5 <--- thats from the route bucket
X-RateLimit-Remaining: 0 <--- thats from the route bucket
retry-after: 30 <--- thats from the route bucket
x-ratelimit-reset: 1695987256 <--- thats from the route bucket
...
Furthermore:
I would expect another result if i would be limited due to the global bucket.
For example if i would overflow the global bucket with api/v2 requests, api/v1 requests should return:
...
X-RateLimit-Limit: 600 <--- thats from the global bucket
X-RateLimit-Remaining: 0 <--- thats from the global bucket
retry-after: 300<--- thats from the global bucket
x-ratelimit-reset: 1695987256 <--- thats from the global bucket
...
from ratelimiter.
Related Issues (11)
- Logo Design HOT 1
- Possible to tag a release? HOT 5
- Setting limits that aren't per second HOT 2
- Timeout TTL set incorrectly HOT 2
- Hit TTL potentially set incorrectly... HOT 2
- Cache record expiration time is erroneously passed as a float HOT 1
- User-Resolver: sha1() expects parameter 1 to be string, int given HOT 1
- All routes and users are spammed with response error 429 HOT 1
- Setting 24 hour rate limit HOT 1
- redis's reference implementation "Sliding Window Rate Limiting" HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ratelimiter.