5
votes

I'm currently using the RabbitMQ (3.6.2-1) on Ubuntu(16.04) in production. Producers publish messages and consumers consume messages and everything works correctly but sometimes RabbitMQ doesn't release memory and it touchs max memory and producers can not publish message into empty queues so I have to restart the service.

It's a bug or something else?

enter image description here

Update :

It is from the management plugin, so you can solve this issue by one of these solutions :

1.Update your RabbitMQ version (3.6.15 is stable)

2.Restarting statistics database periodically (in crontab hourly) https://www.rabbitmq.com/management.html#stats-db

3.set rates_mode to none in your rabbitmq.config file (it's not a good idea because in this case you can not see message rates)

1
How many queues, consumers, connections in your RabbitMQ server? - menya
I have 10 queues , 60 connections and 20 channels - Milux

1 Answers

2
votes

You should check the number of the messages you have inside you queues.

RabbitMQ by default keeps the messages in memory to be fast.

if you have to handle lot of messages you can use the lazy queue: https://www.rabbitmq.com/lazy-queues.html With lazy queue you can handle milions of messages wihtout impact too much the node memory.

Or it could be a mamagement memory problem, see: http://rabbitmq.com/management.html#stats-db in your canse you can run:

rabbitmqctl eval 'supervisor2:terminate_child(rabbit_mgmt_sup_sup, rabbit_mgmt_sup), rabbit_mgmt_sup_sup:start_child().' to reset the stats and free the memory. You could call it periodically

Note:

There are different ways to reset the stats, it depends from the rabbitmq version, here all the detail