weyoss / redis-smq

A simple high-performance Redis message queue for Node.js.
MIT License
588 stars 64 forks source link

Invalid rateLimit.interval. Expected a positive integer >= 1000 #76

Closed PhilHannent closed 2 years ago

PhilHannent commented 2 years ago

Hi,

We are implementing the rate limit and have found an unexpected error: Invalid rateLimit.interval. Expected a positive integer >= 1000

We are talking to a legacy API and its performance means we want to limit the number of requests to it so we have chosen a safe value of 1 request every half a second:

queueManager.setQueueRateLimit(queueName, { limit: 1, interval: 500 }, (errInner) => {

We were hoping to lower this once we are sure the production system can handle the request load. Can the check for the interval be lower?

weyoss commented 2 years ago

The minimum value of 1 sec for rate limiting interval is required for various reasons:

We were hoping to lower this once we are sure the production system can handle the request load. Can the check for the interval be lower?

No. You should consider adjusting your rate limit interval with a value no less than 1 sec.

weyoss commented 2 years ago

Closing as resolved.