-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Que in a multi-node environment #10
Comments
Hey @odarriba! This is an excellent question and something that I have previously deliberated a lot. In the end, I decided to not include this in
How/when/if an application should be replicated to another node is up to the developer. See the Distributed Applications guide on the Erlang website. All that said, for a simple node failover model, this should be pretty straightforward. You can take a look at how |
Thinking about this more (and seeing how quickly your post got many 👍), I might have to reconsider my position on this. I'm open to the idea of integrating this into Que if we're able to come up with sane defaults that are easy to change and do not negatively affect the developer experience. PRs/Issues are welcome if you have any ideas on how to approach this. |
I might suggest adding a node parameter to the que table so that queue entries are associated with the node they were created on. My cluster handles about half a billion device reports per day and spans multiple nodes. There are certain tasks I'd like to queue up but they'd overwhelm any single node responsible for handling them. |
Or possibly use Mnesia local table type although I'm not entirely sure with all of the details of that table type. |
@odarriba because I needed some additional functionality I made a fork this morning. I have added the ability to set a priority level on jobs such that all Additionally the schema has been updated to include current node. So that when restarting only jobs queued on a specific node will be requeued. I have not yet added load balancing logic since I don't need it for my immediate needs but you can simulate it well enough using something like.
Or if using the original version of the code.
use :rpc.cast if you don't care about confirmation. @sheharyarn you have written some fantastically readable code here ^_^ keep up the good work. If you'd like to incorporate the priority logic chat with me sometime. I'll continue to refine it either way on my fork since I need to very efficiently process tens of thousands of jobs a minute with prioritization. |
Thank you for the suggestions @noizu (and sorry for the late reply!). I took a quick look at your fork and it looks very interesting. Over the next few weeks, I'll try to come up with a plan for adding distributed job execution support, and will post back here with an update. |
My fork has been working pretty well and handling a few hundred thousand
tasks per day. But i did some things for expediency that you're not going
to want upstream. There also seems to be a bug with the memento dependency
it doesn't correctly compile first when including Que in a project.
…On Fri, Jan 18, 2019 at 12:54 PM Sheharyar Naseer ***@***.***> wrote:
Thank you for the suggestions @noizu <https://github.com/noizu> (and
sorry for the late reply!). I took a quick look at your fork and it looks
very interesting. Over the next few weeks, I'll try to come up with a plan
for adding distributed job execution support, and will post back here with
an update.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AGAaBh07aoeTcqWcqllY9xTKq4_14rtbks5vEWGDgaJpZM4YvW3t>
.
|
We are trying to use Que to schedule jobs in a multi-node environment, allowing nodes to connect to each other and share mnesia information.
What I'm doing:
Check that they are connected with a
Node.list()
on both sidesSpawn 100 jobs of my TestWorker(which puts a log message and waits one second)
It works, but all jobs run only on one of the nodes (lets say node1), while on the other (node2) no job is executed.
Also, if I execute the same
for
onnode2
, all jobs are executed innode1
too.is there anything we can do to:
:mnesia
remains in the rest of the cluster.Thanks in advace!
PD: I have also tried executing the setup of mnesia persisted in disk, with this result:
The text was updated successfully, but these errors were encountered: