Open Spyes opened 4 years ago
@Spyes - I think that is the right approach if you wish to drop any request that overflows the 20 limitations every 1000ms.
I'd also suggest using maxConcurrent
and minTime
as recommended to better stagger the requests.
I'm trying to rate limit requests to an express route, and I want to limit it to 20 jobs per second, any more jobs and I return
429 Too Many Requests
, but I'm not sure I understand the configuration exactly...If I understand it correctly, this will set the
reservoir
to 20 every 1000ms, and becausehighWater
is set to 0, it will drop any request that overflow from the reservoir. Please correct me if I'm wrong :) Thanks! And great library, by the way - amazing work!