Replies: 1 comment 5 replies
-
I think that when scaling down you just need to make sure your workers are closed gracefully by waiting for current jobs that are being processed so that kubernetes waits until the nodejs processes return cleanly instead of killing them before they manage to finish by themselves. So probably you need to do is to listen to some signal "SIGINT" or whatever kubernetes sends to the process when scaling down, and in that handler do a "await worker.close()" and after that a process.exit(0). |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Hi, we have been using this package for a long time now at TexAu. Thanks for creating this awesome package.
We had a recent use case where we create a new queue with the execution id as the name for each of our user's executions. Each execution has many sub-executions (jobs added to the queue) and they should only run one at a time. To handle this, whenever a queue is created, we pass a concurrency as 1.
The first issue is that whenever we update our server, we have to recreate all the queues again for all the running executions. This we already handled using an API and pass all the running execution id to create the queue again. Is there a better way to handle this?
The 2nd question and much more important is that our server runs on a k8s cluster and it scales up and down based on the load. I assume all the queues created on the servers that were created during scale-up are lost when they are scaled-down. Is there a way we can handle this situation?
I think if we have a way to know the current concurrency value of a queue, we can create those queues again when their concurrency is 0 or if the queue itself doesn't exist. We don't want to create all the queues again and again as that will increase their concurrency.
We are open to any alternative solution that you can provide for this case.
We also checked bullmq, but found out that it will also have the same limitations.
Beta Was this translation helpful? Give feedback.
All reactions