| Author |
Message |
|
| Guest |
Posted: Wed May 14, 2008 8:42 am |
|
|
|
Guest
|
hello,
since some days Im trying to learn and understand rabbitmq. I think
the decoupling between routing information and stored data very nice
and flexible. I was able to configure the typical pub/sub scenario
with one publisher and many subsriber. The publisher sends the
messages to the exchange and the exchanges routes the messages to
several queues. On each queue one subscriber is listening. If i send
the messages transient without storing them to memory or harddisk
everything works how it supposed to be. (each subsriber receives all
messages). If i switch to persistent messages some problems occur and
i dont know why.
1. if my producer sends only a small amount of messages (lets say
5000), then all queues receive all messages persistent and everything
is ok
2. if my producer sends a larger amount of messages (lets say 100000),
then some strange behaviour appears. All queues receive only some of
this messages. Sometimes 80% sometimes 50% sometimes even only 10% =>
i couldnt discover any pattern, it seemed to be just random
So Im wondering why this happens. Could it be that there are too many
messages to persist and the broker cant handle it because of i dont
know too less memory or some like this ?
Another question: Lets say we have 5 subscriber (each listen to his
"own" queue) in the pub / sub scenario and we want persistent message
storing. Does this mean that each messages is stored 5 times ? (and
for n subscribers n times which would cause a big overhead)
Or maybe Im doing something completly wrong in realising a durable
pub/sub scenario where every subsriber must receive all messages.
Thank you
best regards
Lars
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed May 14, 2008 7:46 pm |
|
|
|
Guest
|
Lars,
Lars Bachmann wrote:
> 1. if my producer sends only a small amount of messages (lets say
> 5000), then all queues receive all messages persistent and everything
> is ok
> 2. if my producer sends a larger amount of messages (lets say 100000),
> then some strange behaviour appears. All queues receive only some of
> this messages. Sometimes 80% sometimes 50% sometimes even only 10% =>
> i couldnt discover any pattern, it seemed to be just random
Could you send us the client code, please? I'd like to try reproducing this.
> So Im wondering why this happens. Could it be that there are too many
> messages to persist and the broker cant handle it because of i dont
> know too less memory or some like this ?
The way you described it above, the messages should certainly get routed
to (and persisted by) all the queues.
Are there any errors in the server logs?
> Another question: Lets say we have 5 subscriber (each listen to his
> "own" queue) in the pub / sub scenario and we want persistent message
> storing. Does this mean that each messages is stored 5 times ? (and
> for n subscribers n times which would cause a big overhead)
In a non-clustered setup only one copy of the message is stored. In a
cluster we store one copy of the message *per node* that has queues to
which the message was routed.
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Thu May 15, 2008 10:50 am |
|
|
|
Guest
|
hello,
> Lars,
>
> Lars Bachmann wrote:
>> 1. if my producer sends only a small amount of messages (lets say
>> 5000), then all queues receive all messages persistent and
>> everything is ok
>> 2. if my producer sends a larger amount of messages (lets say
>> 100000), then some strange behaviour appears. All queues receive
>> only some of this messages. Sometimes 80% sometimes 50% sometimes
>> even only 10% => i couldnt discover any pattern, it seemed to be
>> just random
>
> Could you send us the client code, please? I'd like to try reproducing this.
i attached the sources of the producer
>> So Im wondering why this happens. Could it be that there are too
>> many messages to persist and the broker cant handle it because of
>> i dont know too less memory or some like this ?
>
> The way you described it above, the messages should certainly get
> routed to (and persisted by) all the queues.
>
> Are there any errors in the server logs?
there are no errors in the logs
>> Another question: Lets say we have 5 subscriber (each listen to his
>> "own" queue) in the pub / sub scenario and we want persistent
>> message storing. Does this mean that each messages is stored 5
>> times ? (and for n subscribers n times which would cause a big
>> overhead)
>
> In a non-clustered setup only one copy of the message is stored. In a
> cluster we store one copy of the message *per node* that has queues to
> which the message was routed.
thank you for information
>
> Matthias.
Lars
Post received from mailinglist |
|
|
| Back to top |
|
| tonyg |
Posted: Fri May 16, 2008 11:26 am |
|
|
|
User
Joined: 07 Nov 2006
Posts: 199
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 11:59 am |
|
|
|
Guest
|
hi,
now the sources are attached
lars
> Hi Lars,
>
> Lars Bachmann wrote:
>> i attached the sources of the producer
>
> Could you also please send us code for the consumer?
>
> Regards,
> Tony
> --
> [][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211
> [][] LShift Ltd | Tel: +44 (0)20 7729 7060
> [] [] http://www.lshift.net/ | Email: tonyg@lshift.net
>
>
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 12:06 pm |
|
|
|
Guest
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 12:37 pm |
|
|
|
Guest
|
Zitat von Matthias Radestock <matthias@lshift.net>:
> Lars,
>
> Lars Bachmann wrote:
>> now the sources are attached
>
> They were attached before.
>
> However, these are still only the sources for the message *producer*.
> Where is the code for the *consumer*?
>
>
> Matthias.
well the consumer is not important in this case, because the error is
that not all messages which the producer sends are received in each
queue (persistent). The consumer just reads the messages from one
queue. The error supposed to be within the producer because the
messages are not stored correctly. When Im sending 60000 messages to
one exchange which routes them to 2 queues but the 2 queues dont
receive this 60000 messages, the consumer has nothing to do with it.
Lars
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 12:43 pm |
|
|
|
Guest
|
Lars,
Lars Bachmann wrote:
> well the consumer is not important in this case, because the error is
> that not all messages which the producer sends are received in each
> queue (persistent). The consumer just reads the messages from one queue.
> The error supposed to be within the producer because the messages are
> not stored correctly. When Im sending 60000 messages to one exchange
> which routes them to 2 queues but the 2 queues dont receive this 60000
> messages, the consumer has nothing to do with it.
How did you find out all the above when you haven't got a consumer? I.e.
how did you determine that "not all messages which the producer sends
are received in each queue"?
In order to reproduce your problem I need to know what you measured /
looked at.
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 1:14 pm |
|
|
|
Guest
|
Mathias,
Im using the erlang shell to connect to the broker. With
"rabbit_amqqueue:stat_all()." i get a list of all queues with the
messages of the broker. And the message count for the listed queues is
not correct. but always when i sent a small amount of messages
everything is ok, only with big amounts something goes wrong. Are
there some parameters for limitation ? hm im running the broker on a
virtual machine (openvz), maybe there are limitations, maybe i should
set up the broker on another computer ... i dont know
Lars
> Lars,
>
> Lars Bachmann wrote:
>> well the consumer is not important in this case, because the error
>> is that not all messages which the producer sends are received in
>> each queue (persistent). The consumer just reads the messages from
>> one queue. The error supposed to be within the producer because the
>> messages are not stored correctly. When Im sending 60000 messages
>> to one exchange which routes them to 2 queues but the 2 queues dont
>> receive this 60000 messages, the consumer has nothing to do with it.
>
> How did you find out all the above when you haven't got a consumer?
> I.e. how did you determine that "not all messages which the producer
> sends are received in each queue"?
>
> In order to reproduce your problem I need to know what you measured /
> looked at.
>
>
> Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 2:12 pm |
|
|
|
Guest
|
Lars,
Lars Bachmann wrote:
> Im using the erlang shell to connect to the broker. With
> "rabbit_amqqueue:stat_all()." i get a list of all queues with the
> messages of the broker. And the message count for the listed queues is
> not correct.
When do you perform this check? Straight after your producer has terminated?
Is the Erlang VM idle when you perform the check?
basic.publish is asynchronous; the messages may get buffered in various
places before eventually hitting the queues.
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 3:02 pm |
|
|
|
Guest
|
Mathias,
i perform this check after my producer has terminated, but even if i
make this test some minutes later still the same result. I send 60000
messages and only for example 48000 are in the queue. (i actually
noticed it has nothing to do with pub/sub scenario its only about the
amount of messages i sent persistent). So there are always some
messages in the queue but not all. Now i connected a consumer to the
queue and it receives only the amount of messages which were in the
queue. (which means 48000 in the above example). I attached also the
client of the consumer, which is the a modified simpletopic consumer
from the cleint package.
Lars
> Lars,
>
> Lars Bachmann wrote:
>> Im using the erlang shell to connect to the broker. With
>> "rabbit_amqqueue:stat_all()." i get a list of all queues with the
>> messages of the broker. And the message count for the listed queues
>> is not correct.
>
> When do you perform this check? Straight after your producer has terminated?
>
> Is the Erlang VM idle when you perform the check?
>
> basic.publish is asynchronous; the messages may get buffered in various
> places before eventually hitting the queues.
>
>
>
> Matthias.
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 3:17 pm |
|
|
|
Guest
|
Lars,
Lars Bachmann wrote:
> i perform this check after my producer has terminated, but even if i
> make this test some minutes later still the same result. I send 60000
> messages and only for example 48000 are in the queue.
Interesting. I have a few theories of what might be happening. Could you
try the following experiments and let me know whether the results change?
1) delay the call to channel.close in the producer
2) set the "mandatory" flag in the basicPublish call - see the 7-arg
version of that method.
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 4:02 pm |
|
|
|
Guest
|
Mathias,
by now i tried only 1) and it definitly has some affect. I was able to
send 70000, 100000 and 150000 messages and all were received by the
broker. When i wanted to send 200000 i got a socketconnection
exception. Next week i ll take a closer look why this happened and i
ll also try out the mandatory flag.
So it seems that the channel was already closed but not all messages
were sent, very interessting. Thank you for your help. Next week i ll
give some more feedback.
Lars
> Lars,
>
> Lars Bachmann wrote:
>> i perform this check after my producer has terminated, but even if
>> i make this test some minutes later still the same result. I send
>> 60000 messages and only for example 48000 are in the queue.
>
> Interesting. I have a few theories of what might be happening. Could
> you try the following experiments and let me know whether the results
> change?
>
> 1) delay the call to channel.close in the producer
>
> 2) set the "mandatory" flag in the basicPublish call - see the 7-arg
> version of that method.
>
>
> Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 4:31 pm |
|
|
|
Guest
|
Lars,
Lars Bachmann wrote:
> by now i tried only 1) and it definitly has some affect. I was able to
> send 70000, 100000 and 150000 messages and all were received by the
> broker. When i wanted to send 200000 i got a socketconnection exception.
Thanks for running this experiment. These results give me something to
go on.
Btw, what version of RabbitMQ and what O/S are you running?
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Fri May 16, 2008 6:04 pm |
|
|
|
Guest
|
Lars,
Matthias Radestock wrote:
> Lars Bachmann wrote:
>> by now i tried only 1) and it definitly has some affect. I was able to
>> send 70000, 100000 and 150000 messages and all were received by the
>> broker. When i wanted to send 200000 i got a socketconnection exception.
>
> Thanks for running this experiment. These results give me something to
> go on.
I think I've found the problem, though if my analysis is correct I would
have expected an error in the server logs. Are you sure there is nothing
unusual in there? Perhaps you could send me the log output recorded by
the server when running your test program (in its original form, i.e.
without the delay in closing the channel).
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
|
|