<div dir="ltr">Hi Simon,<div><br></div><div style>I have more information for you. It turns out I hadn't fully understood the interaction causing this to happen.</div><div style><br></div><div style>Aside from their regular communication, our services also declare a queue bound on # to an exchange that we use for collecting stats the services store internally. In addition to hitting the REST API for information about the broker, the monitor also opens a connection/channel, declares an anonymous queue for itself, then sends a message indicating to our services that they should respond with their statistics. The services then send a message with a routing key that will direct the response onto the queue declared by the monitor. This happens every five seconds.</div>
<div style><br></div><div style>It appears that this is in fact responsible for memory consumption growing out of control. If I disable that aspect of monitoring and leave the REST API monitor up, memory consumption stays level.</div>
<div style><br></div><div style>The problem seems reminiscent of the issues described in this mailing list thread: <a href="http://rabbitmq.1065348.n5.nabble.com/RabbitMQ-Queues-memory-leak-td25813.html">http://rabbitmq.1065348.n5.nabble.com/RabbitMQ-Queues-memory-leak-td25813.html</a>. However, the queues we declare for stats collection are *not* mirrored.</div>
<div style><br></div><div style>Hope that helps narrow things down. :)</div><div style><br></div><div style>Best, Travis</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 12:58 PM, Travis Mehlinger <span dir="ltr"><<a href="mailto:tmehlinger@gmail.com" target="_blank">tmehlinger@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Simon,<div><br></div><div>I flipped our monitor back on and let Rabbit consume some additional memory. Invoking the garbage collector had no impact.</div>
<div><br></div><div>Let me know what further information you'd like to see and I'll be happy to provide it.</div>
<div><br></div><div>Thanks, Travis</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 17, 2013 at 10:32 AM, Simon MacMullen <span dir="ltr"><<a href="mailto:simon@rabbitmq.com" target="_blank">simon@rabbitmq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 17/06/13 15:45, Travis Mehlinger wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Simon,<br>
<br>
Thanks for getting back to me. I'll need to restart our monitor and give<br>
it some time to leak the memory. I'll let you know the results sometime<br>
later today.<br>
<br>
One thing I failed to mention in my initial report: whenever we<br>
restarted one of our services, the queues they were using would get<br>
cleaned up (we have them set to auto-delete) and redeclared. Whenever we<br>
did that, we would see the memory consumption of the management DB fall<br>
off sharply before starting to rise again.<br>
</blockquote>
<br></div>
That is presumably because the historical data the management plugin has been retaining for those queues got thrown away. If you don't want to retain this data at all, change the configuration as documented here:<br>
<br>
<a href="http://www.rabbitmq.com/management.html#sample-retention" target="_blank">http://www.rabbitmq.com/<u></u>management.html#sample-<u></u>retention</a><br>
<br>
However, I (currently) don't believe it's this historical data you are seeing as "leaking" since making queries should not cause any more of it to be retained.<br>
<br>
Cheers, Simon<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Let me know if you'd like any further information in the meantime.<br>
<br>
Best, Travis<br>
<br>
<br>
On Mon, Jun 17, 2013 at 6:39 AM, Simon MacMullen <<a href="mailto:simon@rabbitmq.com" target="_blank">simon@rabbitmq.com</a><br></div><div>
<mailto:<a href="mailto:simon@rabbitmq.com" target="_blank">simon@rabbitmq.com</a>>> wrote:<br>
<br>
Hi. Thanks for the report.<br>
<br>
My first guess is that garbage collection for the management DB<br>
process is happening too slowly. Can you invoke:<br>
<br>
$ rabbitmqctl eval<br></div>
'P=global:whereis_name(rabbit_<u></u>__mgmt_db),M1=process_info(P,<br>
memory),garbage_collect(P),M2=<u></u>__process_info(P,<br>
memory),{M1,M2,rabbit_vm:__<u></u>memory()}.'<div><div><br>
<br>
and post the results?<br>
<br>
Cheers, Simon<br>
<br>
On 15/06/13 03:09, Travis Mehlinger wrote:<br>
<br>
We recently upgraded RabbitMQ from 3.0.4 to 3.1.1 after noticing<br>
two bug<br>
fixes in 3.1.0 related to our RabbitMQ deployment:<br>
<br>
* 25524 fix memory leak in mirror queue slave with many<br>
short-lived<br>
publishing channel<br>
* 25290 fix per-queue memory leak recording stats for mirror<br>
queue slaves<br>
<br>
However, in our case, it seems that the management plugin may<br>
still have<br>
a memory leak. We have a monitoring agent that hits the REST API to<br>
gather information about the broker (number of queues, queue depth,<br>
etc.). With the monitoring agent running and making requests<br>
against the<br>
API, memory consumption steadily increased; when we stopped the<br>
agent,<br>
memory consumption in the management plugin leveled off.<br>
<br>
Here a couple graphs detailing memory consumption in the broker (the<br>
figures are parsed from rabbitmqctl report). The first graph<br>
shows the<br>
ebb and flow of memory consumption in a number of components and the<br>
second shows just consumption by the management plugin. You can see<br>
pretty clearly where we stopped the monitoring agent at 1:20.<br>
<br></div></div>
<a href="https://dl.dropboxusercontent." target="_blank">https://dl.dropboxusercontent.</a><u></u>__com/u/7022167/Screenshots/n-<u></u>__np6obt-m9f.png<br>
<<a href="https://dl.dropboxusercontent.com/u/7022167/Screenshots/n-np6obt-m9f.png" target="_blank">https://dl.<u></u>dropboxusercontent.com/u/<u></u>7022167/Screenshots/n-np6obt-<u></u>m9f.png</a>><br>
<a href="https://dl.dropboxusercontent." target="_blank">https://dl.dropboxusercontent.</a><u></u>__com/u/7022167/Screenshots/__<u></u>an6dpup33xvx.png<div><br>
<<a href="https://dl.dropboxusercontent.com/u/7022167/Screenshots/an6dpup33xvx.png" target="_blank">https://dl.<u></u>dropboxusercontent.com/u/<u></u>7022167/Screenshots/<u></u>an6dpup33xvx.png</a>><br>
<br>
We have two clustered brokers, both running RabbitMQ 3.1.1 on Erlang<br>
R14B-04.1. There are typically around 200 queues, about 20 of<br>
which are<br>
mirrored. There are generally about 200 consumers. Messages are<br>
rarely<br>
queued and most queues typically sit idle.<br>
<br>
I'll be happy to provide any further diagnostic information.<br>
<br>
Thanks!<br>
<br>
<br></div>
______________________________<u></u>___________________<br>
rabbitmq-discuss mailing list<br>
rabbitmq-discuss@lists.__<a href="http://rabbitmq.com" target="_blank">rabbi<u></u>tmq.com</a><br>
<mailto:<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@<u></u>lists.rabbitmq.com</a>><br>
<a href="https://lists.rabbitmq.com/__cgi-bin/mailman/listinfo/__rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/__<u></u>cgi-bin/mailman/listinfo/__<u></u>rabbitmq-discuss</a><div><br>
<<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/<u></u>cgi-bin/mailman/listinfo/<u></u>rabbitmq-discuss</a>><br>
<br>
<br>
<br>
--<br>
Simon MacMullen<br>
RabbitMQ, Pivotal<br>
<br>
<br>
</div></blockquote><div><div>
<br>
<br>
-- <br>
Simon MacMullen<br>
RabbitMQ, Pivotal<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>