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

Matthias Radestock matthias at rabbitmq.com
Wed Jan 2 10:23:07 GMT 2013


On 02/01/13 09:58, Jervis Liu wrote:
> 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.

That's likely the socket buffers. By default rabbit just leaves their 
sizing to the O/S. You can tune their size by setting sndbuf, recbuf and 
buffer in the rabbit tcp_listen_options, e.g. put the following in your 
rabbitmq.config file:

[{rabbit, [{tcp_listen_options, [binary,
                                  {sndbuf,        1024},
                                  {recbuf,        1024},
                                  {buffer,        1024},
                                  {packet,        raw},
                                  {reuseaddr,     true},
                                  {backlog,       128},
                                  {nodelay,       true},
                                  {linger,        {true, 0}},
                                  {exit_on_close, false}]}]}].

(all the other values are copies of the default config)



More information about the rabbitmq-discuss mailing list