Is there a product-ready alternative to Disque?
Disque 1.0 RC1 is out
11–20 of 54 posts
Re: Disque 1.0 RC1 is out
#12Disque is definitely exciting, and looks like it can replace RabbitMQ, which has serious flaws in its clustering design. I'm looking forward to trying it out. However, if some constructive criticism is permitted, I have to say that, having written distributed applications for many years, I have come to dislike the "classical" push/pop queue data model: * Acking is a bad idea. It requires the broker to manage a lot of…
We attempted to use Kafka as part of a job management system, where long-running jobs were scheduled and workers consumed partitions, but what we found was that since consumers work on partitions, a long-running task could block an entire partition's worth of work, with no way to migrate it to another partition.
Kafka works really well when the bottleneck is the broker to begin with -- if you have a lot of small, lightweight messages being passed to other systems, and the broker is having trouble keeping up. Analytics and logs are great examples where Kafka's data model works really well.
But for a smaller number of larger messages that takes seconds to minutes to process (we were using it to schedule data downloads and video processing), workers could be sitting idle while there was still plenty more work to do.
We moved to Amazon SQS for now, but I imagine we'll move to something like Disque in the future.
Re: Disque 1.0 RC1 is out
#13Disque is definitely exciting, and looks like it can replace RabbitMQ, which has serious flaws in its clustering design. I'm looking forward to trying it out. However, if some constructive criticism is permitted, I have to say that, having written distributed applications for many years, I have come to dislike the "classical" push/pop queue data model: * Acking is a bad idea. It requires the broker to manage a lot of…
Does a proper "queing" project, that is messaging independant exists ? That would open the door to a standardization of the queing semantics and API.
Like, if I want to use crossbar.io (with it's WAMP protocol) for the messaging part, but need task queue, what are my options ?
Re: Disque 1.0 RC1 is out
#14Is there a product-ready alternative to Disque?
Re: Disque 1.0 RC1 is out
#15Re: Disque 1.0 RC1 is out
#16Disque is definitely exciting, and looks like it can replace RabbitMQ, which has serious flaws in its clustering design. I'm looking forward to trying it out. However, if some constructive criticism is permitted, I have to say that, having written distributed applications for many years, I have come to dislike the "classical" push/pop queue data model: * Acking is a bad idea. It requires the broker to manage a lot of…
Re: Disque 1.0 RC1 is out
#17Disque is definitely exciting, and looks like it can replace RabbitMQ, which has serious flaws in its clustering design. I'm looking forward to trying it out. However, if some constructive criticism is permitted, I have to say that, having written distributed applications for many years, I have come to dislike the "classical" push/pop queue data model: * Acking is a bad idea. It requires the broker to manage a lot of…
Kafka has a different data model which works for some scenarios, but not others. We attempted to use Kafka as part of a job management system, where long-running jobs were scheduled and workers consumed partitions, but what we found was that since consumers work on partitions, a long-running task could block an entire partition's worth of work, with no way to migrate it to another partition. Kafka works really well w…
* Has a well-defined lifetime — unstarted, running, paused, completed successfully, or failed;
* Is executed from some kind of parameterized "job specification" that describes its inputs and desired behavior;
* Has state data (e.g., completion % progress, log output, metrics, transactional continutation state for pausing/retrying);
* Can be scheduled on multiple nodes;
* Can be created and scheduled multiple times;
* Can be scheduled by priority;
* Can have its resources (RAM, CPU, I/O) constrained.
The thing is, queues are terrible at this. People continue to abuse messaging systems as a scheduler, and it always sucks.
For example, consider acking: For a long-running tasks that might take hours, do you really want to hold up the broker's internal lock for all that time? What if you restart the broker — the task is still running, now you decoupled its running state from the queue. Similarly, queues are terrible at finding out what's waiting, or what has happened. By using the queue as job state, you are coupling scheduling with execution, which is just wrong.
A queue (one that supports priorities, mind you) is, however, excellent for management commands: "Start job X", "pause job X" and so on. But you will want to maintain execution state separately from the queue. A relational database is quite good at this, though one could use a NoSQL databases, too. First, create a row representing the job: {id="job1", state="new", type="import_stuff", params="..."}. Then push a queue message {commmand="start_job", job_id="job1"}. Run a queue consumer or ten on each node. Each consumer acks the message, finds the job in the table and starts it. One could run it as a child process, or in a Docker container. One could of course use an orchestration service (like Mesos/Marathon) to run it, and monitor the service for container events and update the job table appropriately.
I would want to take it further and allow the job to update itself through API, so that it could publish metrics and log messages, as well as maintain whatever data is useful snapshotting. For example, a long-running task to import data into a database would benefit from maintaining a cursor so that you could pause/kill the job and later resume it at the point where it was.
Re: Disque 1.0 RC1 is out
#18Re: Disque 1.0 RC1 is out
#19Disque is definitely exciting, and looks like it can replace RabbitMQ, which has serious flaws in its clustering design. I'm looking forward to trying it out. However, if some constructive criticism is permitted, I have to say that, having written distributed applications for many years, I have come to dislike the "classical" push/pop queue data model: * Acking is a bad idea. It requires the broker to manage a lot of…
Could you please elaborate on these flaws within RabbitMQ's clustering design? I'm legitimately interested in a discussion on the matter.
RabbitMQ does not have a good strategy for recovering from partitions, which happens when a node is unable to talk to its peers. Partitions can occur not just from actual network hiccups but also simply due to high CPU or I/O load or benign VM migrations.
The underlying cause is that RabbitMQ is not multi-master by default. A queue is owned by a specific node, and if you have a partitioned cluster, that queue (and related objects such as exchanges and bindings) will simply disappear from other nodes.
You can patch this deficiency by enabling "high availability" (HA), which is their term for mirrored queues. Each queue will get a designated master, and be replicated to other nodes automatically. If a partition happens, the nodes elect a node to become a new master for a mirrored queue.
Unfortunately, this opens the cluster up to conflicts. Let's say you have two nodes, A and B, with one queue, Q. You experience brief hiccup causing a partition. A and B will both assume the role of master for Q, because RabbitMQ has no quorum support. Therefore they will continue to accept messages from apps. The hiccup passes, and now both nodes see each other again. Meanwhile, apps had sent messages to both A and B, causing Q to diverge into Q^1 and Q^2.
However, RabbitMQ has no way to consolidate the two versions into a single queue. To fix this situation, either you need to reconstruct the queue manually (usually impossible from an application's point of view), or wipe it (hardly a solution in a production envirionment), or simply have RabbitMQ automatically pick a winning master and discard the other master(s). The latter strategy is called "autoheal", and will automatically pick the master which has the most messages. The previous master(s) are wiped and become slaves. This is coincidentally the only mode in which RabbitMQ can continue to run after a partition without manual intervention. Without autoheal, RabbitMQ will become unusable.
In practice, recovery has proved flaky for us. Nodes often stay partitioned even after they should be able to see each other. We have also encountered a lot of bugs — for example, bindings or exchanges disappear on some nodes but not on others, or queues are inexplicably lost, or nodes otherwise just misbehave. We're on a cloud provider which is otherwise rock solid; of all the software (databases etc.) we employ in our clusters, RabbitMQ is the only one that misbehaves. I should add that the last few minor versions have increased stability considerably, though the fundamental clustering design issue remains.
Re: Disque 1.0 RC1 is out
#20Earlier quoted context omitted.
Kafka has a different data model which works for some scenarios, but not others. We attempted to use Kafka as part of a job management system, where long-running jobs were scheduled and workers consumed partitions, but what we found was that since consumers work on partitions, a long-running task could block an entire partition's worth of work, with no way to migrate it to another partition. Kafka works really well w…
I would argue that job management is unrelated to messaging, at least according my loose definition of a task that: * Has a well-defined lifetime — unstarted, running, paused, completed successfully, or failed; * Is executed from some kind of parameterized "job specification" that describes its inputs and desired behavior; * Has state data (e.g., completion % progress, log output, metrics, transactional continutation…
In addition, I don't see how you implement priority in a system like this, since Kafka partitions are append-only. One has to process the former start_job messages before you reach the higher priority items.
Having a broker hand out items in priority to workers makes a lot more sense to me.
The job system you described is definitely something missing from the OSS world, and we'd love to open up our system for this eventually. While Disque is not that piece, I think it makes more sense than Kafka.