[rabbitmq-discuss] RabbitMQ binary uses a ton of memory

Jervis Liu jervisliu at gmail.com
Wed Jan 2 09:58:52 GMT 2013


I am having a memory problem with RabbitMQ. My setup is something like
the following:

 - 1 server exclusively running RabbitMQ on Ubunto 11 (16G memory,
set_vm_memory_high_watermark=0.8), RabbitMQ 3.0.1, Erlang R15B03, no
plugin enabled.
 - non-exclusive, durable, non-autodelete queues binds to a durable
and non-autoDelete "fanout" exchange.

As soon as I have 10000+ connections, RabbitMQ starts to eat up a lof
of memory. Most of the memory usage are kind of expected except the
memory used by binary. The memory taken by
binary seems to be consistent, i.e., each connection takes about 88K
memory. The number of 88K is not affected by whether or not there is
any message delivering nor the number is affected by using durable,
non-autodelete queues or non-durable autodelete

Below are some of the memory reports:

4000 connections/queues  (1.251G used by Rabbit. 360M by binary, 90K each conn):
                        {mnesia,"MNESIA  CXC 138 12","4.7.1"},
                        {os_mon,"CPO  CXC 138 46","2.2.10"},
                        {sasl,"SASL  CXC 138 11","2.2.1"},
                        {stdlib,"ERTS  CXC 138 10","1.18.3"},
                        {kernel,"ERTS  CXC 138 10","2.15.3"}]},
 {erlang_version,"Erlang R15B03 (erts- [source] [64-bit]
[smp:16:16] [async-threads:30] [hipe] [kernel-poll:true]\n"},

22000 connections/queues (4.26G used by Rabbit. 1.936G used by binary):

62000 connections/queues (10.813G used by RabbitMQ. 5.422G used by binary):

Please note, above reports were taken when the system is in a quite
state, ie., no messaged published, no unacked messages, no message is
ready in the queue. The doc says "Binarys is the Memory used by shared
binary data in the Erlang VM. In-memory message bodies show up here.".
However my observation is that the binary takes ton of memory even
when there is no message is being delivered in the system. I made this
sure by starting RabbitMQ from a fresh state (rabbitmqctl reset), then
going ahead to create 22000 connections, there is absolutely no
message published to the Rabbit when I printed the memory report.
binary still took about 1.936G (88K each connection).

I am wondering if this memory usage of binary is an expected behavior
(I hope it is not) or I am missing anything?  Any help is appreciated.


More information about the rabbitmq-discuss mailing list