How to isolate limiter
config when working with horizontal scaling
#2485
-
DescriptionHey, first of all great library. It's really saving me a lot of time! 😄 I have a question about how to use Bull with my application that supports horizontal scaling. BullModule.registerQueue({
name: "assets",
limiter: {
// Max 1 jobs every 10 seconds
max: 1,
duration: 10000,
},
}) When my application has spun up multiple instance (the horizontal scaler) still only processes 1 job every 10 seconds. QuestionIs it possible to make the Should I look at it differently and create a separate |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Bull is a distributed queue system, therefore the limiters are per queue, independent of how many processes you spawn to process the jobs in a given queue. If you need different limiters then you should use a different queue. Also, if you are new to Bull I recommend you to use BullMQ as the rate-limiter there is more robust than the one in Bull: https://docs.bullmq.io/ https://github.com/taskforcesh/bullmq |
Beta Was this translation helpful? Give feedback.
Bull is a distributed queue system, therefore the limiters are per queue, independent of how many processes you spawn to process the jobs in a given queue. If you need different limiters then you should use a different queue. Also, if you are new to Bull I recommend you to use BullMQ as the rate-limiter there is more robust than the one in Bull: https://docs.bullmq.io/ https://github.com/taskforcesh/bullmq