Wednesday, April 9, 2014

How to configure RabbitMQ to use more memory and disk space




1. move default rabbitmq home directory ( /var/lib/rabbitmq ) into EBS volume, i.e /opt/dm/rabbitmq

2. Create a symlink like /var/lib/rabbitmq pointing to /opt/dm/rabbitmq, This will instruct rabbitMQ to use EBS disk space instead of root space ( ln -s /opt/dm/rabbitmq /var/lib/rabbitmq)

3. Add the below configs(highlighted in green) inside the  /etc/rabbitmq/rabbitmq.conf. it specifies max memory thresholds and minimum disk space 
thresholds to trigger flow controls not to accept connections. We have set those to 100GB and 100B respectively not to trigger flow controls unless it really needs to.

[
  {kernel, [

  ]},
  {rabbit, [
    {tcp_listen_options, [binary, {packet,raw},
                                  {reuseaddr,true},
                                  {backlog,128},
                                  {nodelay,true},
                                  {exit_on_close,false},
                                  {keepalive,false}]},
    {default_user, <<"guest">>},
    {default_pass, <<"guest">>},
    {vm_memory_high_watermark, 100},
    {disk_free_limit, 100}
  ]}
].


4. Restart the rabbitmq : /etc/init.d/rabbitmq-server stop
                                    /etc/init.d/rabbitmq-server start


5. Enable rabbitmq management plugin : /usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management

6. Need to make sure we can access rabbitmq management console on port 55672 for quick queue lookups.


No comments: