[rabbitmq-discuss] fanout exchange that does not keep messages

majek04 majek04 at gmail.com
Tue Jul 21 16:14:10 BST 2009


On Tue, Jul 21, 2009 at 15:31, Brian Whitman<brian at echonest.com> wrote:
> If you want to see the mem growth, use the code (I've updated it) in my blog
> post but just add immediate=True to the basic_publish command. Then I just
> did
> b = Producer()
> for x in xrange(1000000):
>     b.message({"message":"a long message", "id":str(x)})
> and you can just watch the mem increase, whether you have consumers or not.
> (only if immediate=True is on)

I can confirm that. Indeed, when you send 'immediate=True' messages
from python  the memory is growing in a rabbit process.

We even found a source of a problem - it's a python amqp client library.
You see, when an 'immediate' message is not delivered, it's returned to the
sender. But the python library is not reading anything from the socket,
Rabbit is still trying to return messages, but after a while buffers on
network socket are filled and Erlang memory footprint starts to grow.

This is an output from netstat -n:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp    73440      0 127.0.0.1:47121         127.0.0.1:5672          ESTABLISHED
tcp        0  24864 127.0.0.1:5672          127.0.0.1:47121         ESTABLISHED

As you see the buffers are full.

Hope that helps.

Marek Majkowski




More information about the rabbitmq-discuss mailing list