[rabbitmq-discuss] memory usage

Matthias Radestock matthias at lshift.net
Fri Feb 6 18:19:11 GMT 2009


Philip,

Philip Stubbings wrote:
> I have set up Rabbit 1.5.1 running as a single node. During testing, I
> notice that memory use is extremely high. More specifically, if I push
> 1 million messages to a queue and later consume them (with
> acknowledgment) memory usage remains very high (in excess of 3G). I can
> verify that all consumed messages where acknowledged and that the queue
> is empty. Why does the process still require 3G of memory even after 24
> hours of inactivity? 

How did you determine that the queues were empty?

Are your messages flagged as persistent? How big is the persister log 
(usually in /var/lib/rabbitmq/mnesia/rabbit/rabbit_persister.LOG).

Can you send us the code to reproduce the problem?

> The only way to reduce the memory footprint is to restart rabbitmq.,
> However this is not an option for me.

Erlang processes only perform garbage collection when there is some 
activity. That usually isn't a problem, since most systems are not 
expected to be both idle for a long time and have other processes 
needing memory at the same time.

Does the memory usage remain high when you inject & consume some more 
messages?

> The second problem I have encountered is during, and immediately after
> pushing 1 million messages to rabbitmq. If I try to connect a consumer
> whilst messages are being produced, I get the following error on the
> consumer side:
> 
> (connection error; reason:
> {#method<connection.close>(reply-code=541,reply-text=INTERNAL_ERROR,class-id=0,method-id=0),null,""})
> 
> While, on the rabbit server:
> =ERROR REPORT==== 5-Feb-2009::12:43:57 ===
> connection <0.3155.0> (running), channel 1 - error:
> {timeout,{gen_server,call,[rabbit_persister,serial]}}
> =WARNING REPORT==== 5-Feb-2009::12:43:57 ===
> Non-AMQP exit reason
> '{timeout,{gen_server,call,[rabbit_persister,serial]}}'

That looks like the same problem Darien Kindlund reported. See my 
response to him a few moments ago.

> And also, during and just after the 1 million messages have been
> produced (with no consumers connected) I get the following error while
> trying to examine the queue status:
> 
> ../rabbitmq-server-1.5.1/scripts/rabbitmqctl list_queues -p /
> Listing queues ...
> Error: {badrpc,
>            {'EXIT',
> 	        {timeout,
> 			{gen_server,call,[<4472.2308.0>,{info,[name,messages]}]}}}}

The queues are probably busy processing the message backlog. The info 
request will be stuck behind the messages. I have filed a bug to do 
something about that.

Is the kind of bursty behaviour you are testing - with lots of messages 
being injected at a high rate followed by periods of inactivity - 
typical of your application?


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list