KEDA Autoscaler for BullWorkers #2018
-
I have different queues and I am running a consumer group for each queue. Now I need to upscale or downscale the number of consumers instances in the consumer groups based on number of items in queue. Now in KEDA supports https://keda.sh/docs/2.10/scalers/redis-lists/ and Redis Stream https://keda.sh/docs/2.10/scalers/redis-streams/ Is there someway to get the queue length that can be used directly with KEDA Autoscalers ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
You can get the number of jobs waiting in the queue: https://api.docs.bullmq.io/classes/Queue.html#getWaitingCount |
Beta Was this translation helpful? Give feedback.
-
@manast has something changed in v4.0.0 and above when using job priority? The I'm using v4.1.0 and the Without the wait key, KEDA is unable to scale the jobs/objects. Is this something that can be added or is it best to revert to v3.15.x? |
Beta Was this translation helpful? Give feedback.
I have been using the
"bull:_queue_name_:wait"
key with KEDA which allows scaling objects/jobs based on the qty of jobs in the wait list.In the KEDA triggers section for redis, set the
listName
equal to"bull:_queue_name_:wait"
(where_queue_name_
is the name of the queue) and then uselistLength
to trigger the scaling of the jobs/objects in relation to the number of waiting jobs. See example: