<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Code below.&nbsp;</div><div><br></div><div>Chuck, I think you're onto something. Something that I noticed while putting together the test code is that it goes 300mps the first time I run it. Any subsequent runs drop to 80mps. Only a rabbitmq restart gets it back to 300mps, and then only for the first run. Hmmm sounds like a connection leak... &nbsp;</div><div><br></div><div>I can't see anywhere in the code where I'm leaking connections (?) but maybe Bunny (the AMQP Ruby adapter I'm using) is?</div><div><br></div><div>----</div><div><span class="Apple-style-span" style="font-style: italic; ">require "rubygems"</span></div><div><i>require "bunny"</i></div><div><i><br></i></div><div><i>@msg_server = Bunny.new(:spec =&gt; '08')</i></div><div><i>@msg_server.start</i></div><div><i><br></i></div><div><i>def start</i></div><div><i>&nbsp;&nbsp;count ||= 0</i></div><div><i>&nbsp;&nbsp;prev_time ||= Time.now</i></div><div><i>&nbsp;&nbsp;queue = @msg_server.queue("process_telemetry")</i></div><div><i><br></i></div><div><i>&nbsp;&nbsp; # main loop</i></div><div><i>&nbsp;&nbsp;loop do</i></div><div><i>&nbsp;&nbsp; &nbsp;result = queue.pop</i></div><div><i>&nbsp;&nbsp; &nbsp;next if result == :queue_empty</i></div><div><i>&nbsp;&nbsp;</i></div><div><i>&nbsp;&nbsp; &nbsp;count += 1</i></div><div><i>&nbsp;&nbsp; &nbsp;if count &gt; 100</i></div><div><i>&nbsp;&nbsp; &nbsp; &nbsp;t = Time.now</i></div><div><i>&nbsp;&nbsp; &nbsp; &nbsp;puts("msgs pops per sec: #{count / (t - prev_time)}")</i></div><div><i>&nbsp;&nbsp; &nbsp; &nbsp;prev_time = t</i></div><div><i>&nbsp;&nbsp; &nbsp; &nbsp;count = 0</i></div><div><i>&nbsp;&nbsp; &nbsp;end &nbsp; &nbsp;</i></div><div><i>&nbsp;&nbsp;end</i></div><div><i><br></i></div><div><i>end</i></div><div><i><br></i></div><div><i>begin</i></div><div><i>&nbsp;&nbsp;start()</i></div><div><i>ensure</i></div><div><i>&nbsp;&nbsp;puts "stopping"</i></div><div><i>&nbsp;&nbsp;@msg_server.stop</i></div><div><i>end</i></div><div><br></div></div><br><div><div>On 8/09/2009, at 3:23 AM, Chuck Remes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Sep 7, 2009, at 1:07 AM, aisha fenton wrote:<br><br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite">I'm sure I'm doing something wrong since I can't find reference to<br></blockquote><blockquote type="cite">this anywhere else. What I'm seeing is that the performance of<br></blockquote><blockquote type="cite">draining a queue gets slower as the queue size increases.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm aware of the issue in RabbitMQ 1.6 that means that when it runs<br></blockquote><blockquote type="cite">out of physical memory that it's performance degrades because it<br></blockquote><blockquote type="cite">starts swapping out. But I'm not anywhere close to running out of<br></blockquote><blockquote type="cite">memory yet, and the degradation starts almost immediately and<br></blockquote><blockquote type="cite">increases linearly as the queue depth grows.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I am publishing 500mps to an exchange. Each message is about 1KB. I<br></blockquote><blockquote type="cite">have a single fanout queue bound to the exchange. A single consumer is<br></blockquote><blockquote type="cite">popping messages off the queue.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">When the queue is less than 20,000 messages I can pop 300mps off the<br></blockquote><blockquote type="cite">queue. When the queue is 200,000 messages the performance drop to<br></blockquote><blockquote type="cite">40-80mps.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm running RabbitMQ 1.6.0. And nether rabbitmq, the consumer, or the<br></blockquote><blockquote type="cite">publisher are using more than 40% CPU.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I assume I shouldn't be seeing this? Any help much appreciated.<br></blockquote><br>You didn't include any code, but I'm going to take a stab in the dark anyway. If you are using the ruby amqp gem you might be doing something like this:<br><br>def next_message<br> &nbsp;exchange = MQ.fanout 'foo'<br> &nbsp;queue = MQ.queue 'bar'<br><br> &nbsp;queue.bind exchange<br><br> &nbsp;newest_message = queue.pop<br>end<br><br>In the code above the call to MQ.&lt;whatever&gt; is opening a new channel to rabbitmq each time the method is called. You are essentially leaking channels all over the place every time you try to pop a new message.<br><br>If you aren't using the ruby amqp stuff, I still recommend checking your code for whatever library you chose. You only need to allocate a few channels and reuse them.<br><br>cr<br><br></div></blockquote></div><br></body></html>