You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an app with a processor intensive background task. It process a bunch of data that is all related to each other. To get through this quickly I want to launch multiple instances of the background task service. I have a cluster that looks like this.
--Background manager
--Proc node A
--Proc node B
The manager figures out if there is data to be processed and sends it to one of the nodes. I'm using the boiler plate connection pool code from this post.
My background task is pretty intensive, so I'm splitting it up into smaller jobs and sending each small job to one of the nodes. My question is: Is there a way I can have the node send a message saying it is busy? Right now I'm using a return into a variable on the manager, but it seems inelegant.
Yes. Make a jobs table and get them if not busy.
Same difference if you have a processing system make its availability know through the database via a status value. The server will get the notification when it's status changes automatically.
Thanks for the tip. I ended up rolling my own jobs system and just submit the individual jobs through there. A little more legwork to make it work, but seems more scaleable in the long run.
I have an app with a processor intensive background task. It process a bunch of data that is all related to each other. To get through this quickly I want to launch multiple instances of the background task service. I have a cluster that looks like this.
--Background manager
--Proc node A
--Proc node B
The manager figures out if there is data to be processed and sends it to one of the nodes. I'm using the boiler plate connection pool code from this post.
My background task is pretty intensive, so I'm splitting it up into smaller jobs and sending each small job to one of the nodes. My question is: Is there a way I can have the node send a message saying it is busy? Right now I'm using a return into a variable on the manager, but it seems inelegant.
On node
On manager
Is there a better way to do this?
The text was updated successfully, but these errors were encountered: