[rabbitmq-discuss] Memory usage

Rob Harrop rob at rabbitmq.com
Mon May 23 08:55:38 BST 2011


Hagbard,

Since 2.x, RabbitMQ will no longer allow the Erlang process to run out 
of memory and stop due to fast producers and slow consumers.

If you have a fast producer running constantly, accompanied by a slow 
consumer then the number of queued messages will grow. To prevent this 
from causing out of memory problems, Rabbit will throttle the producer 
once the memory high watermark is hit.

The throttling works by simply blocking the producer from sending any 
more data over the TCP socket. Once memory drops below the high 
watermark, due to the consumer catching up or messages being flushed to 
disk, the producer can send data again.

Note that your producer might bounce off the watermark frequently if it 
just keeps publishing without let up.

Rob

Hagbard at gmx.de wrote:
> Hi,
> im new to RabbitMQ and i have a question about the memory usage of RabbitMQ. I read that since RabbitMQ 2.x i don't need to care about fast producers and slow consumers and so don't need to care about the amount of messages in a queue and memory usage. After a test yesterday with 2GB memory and 4M messages in a queue (no consumer) RabbitMQ reached high memory watermark and stopped. Can somebody explain that behaviour?
>
> Thanks a lot
> Hagbard


More information about the rabbitmq-discuss mailing list