Erlang Mailing Lists

Author Message

<  RabbitMQ mailing list  ~  Scheduling algorithms

Guest
Posted: Mon Dec 21, 2009 10:28 am Reply with quote
Guest
Hello

I was just wondering is there a variety of scheduling algorithms within
RabbitMQ (round robin,fair queueing,etc) ?

What is supported native and what is contributed if any ?

Any case studies or so ?

Sincerely


Dragan Zubac


_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Wed Dec 23, 2009 4:36 pm Reply with quote
Guest
Dragan

Sorry, do you mean:

* Scheduling used internally by RabbitMQ

Or do you mean:

* Recommended approaches to scheduling work when using RabbitMQ queues

?

alexis


On Mon, Dec 21, 2009 at 10:27 AM, Dragan Zubac <zubacdragan@gmail.com> wrote:
> Hello
>
> I was just wondering is there a variety of scheduling algorithms within
> RabbitMQ (round robin,fair queueing,etc) ?
>
> What is supported native and what is contributed if any ?
>
> Any case studies or so ?
>
> Sincerely
>
>
> Dragan Zubac
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss@lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Fri Dec 25, 2009 10:43 am Reply with quote
Guest
Hello

Let me explain it with some examples.

There are processes A,B and C that insert messages into RabbitMQ. All this messages should reach point D.

If A,B and C insert various number of messages into RabbitMQ,what algorithms will RMQ use to deliver those messages to D ?

Examples :

A inserts 100 messages
B inserts 100 messages
C inserts 100 messages

Will RMQ send all messages toward D in round-robin fashion or the delivery order will be undermined ? Or maybe in some other fashion ?

A inserts 100 messages
B inserts 100 messages
C inserts 1000 messages

What mechanisms one might have to deliver all this messages to D in desired fashion ? Somebody would like to deliver them in round-robin fashion (send 1 A's message,send 1 B's message,send 1 C's message),others might want to give higher priority to C's messages or so (example : send 10 A's messages,send 10 B's messages,send 100 C's messages),or some other model of delivery that business model could desire ?

I'm asking this questions because business model might be changed on-the-fly,so it might be very important to be able to change the behavior of delivery mechanism to satisfy those business model.

P.S.

I was lazy to add multiply destination points,but I guess You get the point with the above examples as well.

Sincerely

Alexis Richardson wrote:
Quote:
Dragan Sorry, do you mean: * Scheduling used internally by RabbitMQ Or do you mean: * Recommended approaches to scheduling work when using RabbitMQ queues ? alexis On Mon, Dec 21, 2009 at 10:27 AM, Dragan Zubac <zubacdragan@gmail.com> (zubacdragan@gmail.com) wrote: [/code]
Quote:
Hello I was just wondering is there a variety of scheduling algorithms within RabbitMQ (round robin,fair queueing,etc) ? What is supported native and what is contributed if any ? Any case studies or so ? Sincerely Dragan Zubac _______________________________________________ rabbitmq-discuss mailing list rabbitmq-discuss@lists.rabbitmq.com (rabbitmq-discuss@lists.rabbitmq.com) http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss [/code]
[/code]

Post received from mailinglist
Guest
Posted: Sat Dec 26, 2009 11:38 am Reply with quote
Guest
Hi Dragan,

On Fri, Dec 25, 2009 at 11:41:58AM +0100, Dragan Zubac wrote:
> There are processes A,B and C that insert messages into RabbitMQ.
> All this messages should reach point D.

Right, so you have one exchange, and one queue, and you have D
consuming from that queue, and you have A, B and C publishing to the
exchange to which the queue is bound.

> If A,B and C insert various number of messages into RabbitMQ,what
> algorithms will RMQ use to deliver those messages to D ?

Delivery order is not defined except for messages from a single
publisher.

> Examples :
>
> A inserts 100 messages
> B inserts 100 messages
> C inserts 100 messages

What, in parallel? Sequentially? Interleaved? In Rabbit, within a
one-node cluster, order is only determined once the message gets to the
queue. The exchange is a passive entity and can be used in parallel by
several channels.

> Will RMQ send all messages toward D in round-robin fashion or the
> delivery order will be undermined ? Or maybe in some other fashion ?

Once the messages are in the queue, they are delivered round-robin to
the consumers (with certain caveats). But in your case, you only have
one consumer so this doesn't affect you.

From your terminology, I suspect you're thinking in a JMS-style way. You
may wish to read some of the introductions to AMQP.

> A inserts 100 messages
> B inserts 100 messages
> C inserts 1000 messages
>
> What mechanisms one might have to deliver all this messages to D in
> desired fashion ? Somebody would like to deliver them in round-robin
> fashion (send 1 A's message,send 1 B's message,send 1 C's
> message),others might want to give higher priority to C's messages
> or so (example : send 10 A's messages,send 10 B's messages,send 100
> C's messages),or some other model of delivery that business model
> could desire ?

In AMQP, you never ever know to whom you're sending a message. You
publish a message to an exchange. After that, the publisher has (almost)
no idea what happens to the message. This is by design.

If, in the queue, you have A's 100 messages at the start, then B's 100
messages, then C's 1000 messages at the end, then that's the order
they'll come out in. You can't alter that. Also, Rabbit doesn't yet
implement message priorities.

What you could do instead, is to have A, B and C publish in such a way
that their messages get routed to three different queues. Then D can
consume from those queues as it wants - if it just wants all of A's
messages, it can just consume from that, and if it wants to force
round-robin, then by setting QoS prefetch count to 1, and careful use of
acking, it can consume from all three queues in a round robin manner.

Best wishes,

Matthew

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Sat Dec 26, 2009 11:56 am Reply with quote
Guest
Matthew Sackman wrote:

> If, in the queue, you have A's 100 messages at the start, then B's 100
> messages, then C's 1000 messages at the end, then that's the order
> they'll come out in. You can't alter that.

Right. The common practice in MQ systems is that messages are placed on
a queue immediately at their arrival. The queue is a linear list of
messages, thus the strict message ordering is established at that point.
The messages are sent further in the same order. While AMQP
specification doesn't explicitly impose this algorithm, the
implementations are implicitly assumed to behave this way.

Martin

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum