<span style="font-family: arial, sans-serif;">Looking more through the queues, it looks like the queue memory sum adds up based on the most active queues.&nbsp;</span><div style="font-family: arial, sans-serif;"><br></div><div style="font-family: arial, sans-serif;">The more the queues grow in size, the more memory they take up - which makes sense. The problem is that erlang isn't properly reclaiming that memory once it is no longer used. I checked out the memory consumption for all the queues.</div><div style="font-family: arial, sans-serif;"><br></div><div style="font-family: arial, sans-serif;">The top culprits (sorted by memory).</div><div style="font-family: arial, sans-serif;"><div><br></div><div>25152048</div><div>25151848</div><div>21038056</div><div>21038016</div><div>21038016</div><div>19373624</div><div>19373584</div><div>19373584</div><div><br></div><div>None of these queues have any queued messages at all really, though most of them have had queued messages at one time or another in the past.&nbsp;</div><div><br></div><div>The funny thing is, after running the command a second time, many of those queues had dropped back to normal levels, or significantly decreased. In particular, one went from 24mb to 600K. It seems like some of them are at least *trying* to garbage collect.</div><div><br></div><div>I'm also seeing queues that have been heavily used in the past, but haven't had any data going through them for months. One is at 12.8 MB and another at 6.3 MB. This seems to indicate that garbage collection isnt happening for now-inactive queues over long periods of time.</div><div><br></div><div>It seems like a memory leak or bug in garbage collection. Looking at the changelog for the versions of RMQ I don't see anything super relevant that would fix by updating to 3.0.4.</div><div><br></div><div>Having fewer queues will probably help things, seems to me like a deeper problem with rabbitmq though?</div></div><br>On Tuesday, April 16, 2013 12:53:06 PM UTC-4, Ilya Volodarsky wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">We're having some strange memory problems in our rabbit that looks like it's attributed to our queues. We're running Rabbit 3.0.1 in production, here's the management plugin overview: <a href="http://cl.ly/image/0z25241k320Q" target="_blank">http://cl.ly/image/<wbr>0z25241k320Q</a><div><br></div><div>As you can see, we have almost no messages queued, but the server is using 5.7GB of active memory. Here's the memory breakdown of the same node:&nbsp;<a href="http://cl.ly/image/03381l2M3v2p" target="_blank">http://cl.ly/image/<wbr>03381l2M3v2p</a></div><div><br></div><div>The broker claims to be using 4.8 GB to store the 4454 queues. That's strange because most of the queues claim to be using 14kb - 23kb, which AFAIK, is the in the correct range for an idle queue. An average of 20kb per queue * 4500 queues = 90 MB, not 4800 MB (53 times bigger).&nbsp;</div><div><br></div><div>Here's the JSON description of a queue from the /queues call:</div><div><br></div><div>{"memory":14624,"idle_since":"<wbr>2013-04-15 22:45:20","policy":"","<wbr>exclusive_consumer_tag":"","<wbr>messages_ready":0,"messages_<wbr>unacknowledged":0,"messages":<wbr>0,"consumers":4,"active_<wbr>consumers":4,"backing_queue_<wbr>status":{"q1":0,"q2":0,"delta"<wbr>:["delta","undefined",0,"<wbr>undefined"],"q3":0,"q4":0,"<wbr>len":0,"pending_acks":0,"<wbr>target_ram_count":0,"ram_msg_<wbr>count":0,"ram_ack_count":0,"<wbr>next_seq_id":0,"persistent_<wbr>count":0,"avg_ingress_rate":0.<wbr>0,"avg_egress_rate":0.0,"avg_<wbr>ack_ingress_rate":0.0,"avg_<wbr>ack_egress_rate":0.0},"<wbr>messages_details":{"rate":0,"<wbr>interval":90165823981,"last_<wbr>event":1366065920939},"<wbr>messages_ready_details":{"<wbr>rate":0,"interval":<wbr>90165823981,"last_event":<wbr>1366065920939},"messages_<wbr>unacknowledged_details":{"<wbr>rate":0,"interval":<wbr>90165823981,"last_event":<wbr>1366065920939},"name":"<wbr>Ingestion.1899vw88el","vhost":<wbr>"/segment","durable":true,"<wbr>auto_delete":false,"arguments"<wbr>:{},"node":"rabbit@rabbit2"}<br></div><div><br></div><div>A few things to note: we have 4 servers subscribing to every queue, and because of the RMQ client (node-amqp) we're using, it creates a channel per subscription. I realize that's not ideal and we'll be fixing the client to make multiple subscriptions per channel, but either way, the broker reports only 350 MB of the memory use coming from the connections vs. 4.8 GB for queues.&nbsp;</div><div><br></div><div>The broker has also been up for 76 days without downtime, so maybe there's some kind of memory leak? We're seeing the memory go up over time.&nbsp;</div><div><br></div><div>Thanks!</div></blockquote>