<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Chunk.</div><div>I don't know Suhail. And his problem may be different from mine.</div><div><br></div><div><div>To isolate the problem, I've reduce what I'm doing down to the attached code files. One pushes messages, the other pops them.</div><div><br></div><div>I see the problem even when only test_push.rb is running (as long as the queue is sufficiently pre-populated). Nothing else is using rabbitmq when I'm doing the test.</div><div><br></div><div>I'm getting the same problem on several different machines here -- my local MacOSX box and a server class Debian box.&nbsp;</div><div><br></div><div><br></div></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>exchange - durable or not?</div></div></blockquote><div>not durable</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>exchange - type? (Looks like "fanout" from the original post)</div></div></blockquote><div>fanout</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>number of bindings per exchange</div></div></blockquote><div>1</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>queue &nbsp;- durable?</div></div></blockquote><div>not durable</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>publishing settings - require ack? persistent? immediate?</div></div></blockquote><div>no ack, non persistent, and non immediate.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>message size? 1K according to the original post</div></div></blockquote><div>&lt; 1K</div><div><br></div><div><br></div><div><br></div><div><b>test_push.rb&nbsp;</b></div><div><b>---</b></div><div><br></div><div><div><i>require "rubygems"</i></div><div><i>require "bunny"</i></div><div><i><br></i></div><div><i>EXCHANGE = "raw_telemetry"</i></div><div><i>QUEUE = "process_telemetry"</i></div><div><i><br></i></div><div><i>count ||= 0</i></div><div><i>prev_time ||= Time.now</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>msg_server.exchange(EXCHANGE, :type &nbsp;=&gt; :fanout)</i></div><div><i>msg_server.queue(QUEUE).bind(EXCHANGE)</i></div><div><i><br></i></div><div><i>loop do</i></div><div><i><br></i></div><div><i>&nbsp;&nbsp;msg_server.exchange(EXCHANGE).publish("This is my msg")</i></div><div><i>&nbsp;&nbsp;</i></div><div><i>&nbsp;&nbsp;count += 1</i></div><div><i>&nbsp;&nbsp;if count &gt; 100</i></div><div><i>&nbsp;&nbsp; &nbsp;t = Time.now</i></div><div><i>&nbsp;&nbsp; &nbsp;puts("msgs pushes per sec: #{count / (t - prev_time)}")</i></div><div><i>&nbsp;&nbsp; &nbsp;prev_time = t</i></div><div><i>&nbsp;&nbsp; &nbsp;count = 0</i></div><div><i>&nbsp;&nbsp;end</i></div><div><i>&nbsp;&nbsp; &nbsp;</i></div><div><i>end</i></div><div><i><br></i></div><div><i><span class="Apple-style-span" style="font-style: normal; "><div><b>test_pop.rb&nbsp;</b></div><div><b>---</b></div><div><i><span class="Apple-style-span" style="font-style: normal;"><br></span></i></div></span></i></div><div><i><div>require "rubygems"</div><div>require "bunny"</div><div><br></div><div>@msg_server = Bunny.new(:spec =&gt; '08')</div><div>@msg_server.start</div><div><br></div><div>def start</div><div>&nbsp;&nbsp;count ||= 0</div><div>&nbsp;&nbsp;prev_time ||= Time.now</div><div>&nbsp;&nbsp;queue = @msg_server.queue("process_telemetry")</div><div><br></div><div>&nbsp;&nbsp;loop do</div><div>&nbsp;&nbsp; &nbsp;result = queue.pop</div><div>&nbsp;&nbsp; &nbsp;next if result == :queue_empty</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp; &nbsp;count += 1</div><div>&nbsp;&nbsp; &nbsp;if count &gt; 100</div><div>&nbsp;&nbsp; &nbsp; &nbsp;t = Time.now</div><div>&nbsp;&nbsp; &nbsp; &nbsp;puts("msgs pops per sec: #{count / (t - prev_time)}")</div><div>&nbsp;&nbsp; &nbsp; &nbsp;prev_time = t</div><div>&nbsp;&nbsp; &nbsp; &nbsp;count = 0</div><div>&nbsp;&nbsp; &nbsp;end &nbsp; &nbsp;</div><div>&nbsp;&nbsp;end</div><div><br></div><div>end</div><div><br></div><div>begin</div><div>&nbsp;&nbsp;start()</div><div>ensure</div><div>&nbsp;&nbsp;puts "stopping"</div><div>&nbsp;&nbsp;@msg_server.stop</div><div>end</div><div><br></div><div><br></div><div><span class="Apple-style-span" style="font-style: normal;"><i><br></i></span></div></i></div></div></div><br><div><div>On 8/09/2009, at 6:38 AM, Chuck Remes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Are you running the same code as Aisha? Are you the same person or work together? I'm getting a bit confused in this thread.<div><br></div><div>And, someone needs to start showing some code. I'm able to push hundreds of messages per second and never see a drop off in delivery performance regardless of the queue size (until I run out of memory). I don't think it is fair to blame rabbit until we can see your code and understand what you are doing.</div><div><br></div><div>Also, please specify the following things:</div><div><br></div><div>exchange - durable or not?</div><div>exchange - type? (Looks like "fanout" from the original post)</div><div>number of bindings per exchange</div><div>queue &nbsp;- durable?</div><div>publishing settings - require ack? persistent? immediate?</div><div>message size? 1K according to the original post</div><div><br></div><div>Is your test machine paging or swapping? What is the 'top' output for your process and for rabbit at various points of the run cycle? Is it lower or higher when you are getting 300 msg/s than when you are getting 80 msg/s?</div><div><br></div><div>What is your subscriber doing with the data it receives? If you make that process a "no op" how many messages per second can you handle? Does it ever drop off related to queue size? Why are you "popping" messages from the queue isn't of having them pushed automatically?</div><div><br></div><div>This thread has been really frustrating because there has NOT been very much information shared. All I see is "it's slow." Give us more information.</div><div><br></div><div>cr</div><div><br></div><div><br><div><div><div>On Sep 7, 2009, at 11:34 AM, Suhail Doshi wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>2009-09-07 16:33:10,822 INFO [id: 95705166] Processing complete, acknowledged.</div><div>2009-09-07 16:33:10,826 INFO [id: 95705166] Received queue item, processing...</div><div>2009-09-07 16:33:10,878 INFO [id: 95705166] Processing complete, acknowledged.</div> <div>2009-09-07 16:33:10,882 INFO [id: 95705166] Received queue item, processing...</div><div>2009-09-07 16:33:12,839 INFO [id: 95705166] Processing complete, acknowledged.</div><div>2009-09-07 16:33:12,839 INFO [id: 95705166] Received queue item, processing...</div> <div>2009-09-07 16:33:13,531 INFO [id: 95705166] Processing complete, acknowledged.</div><div>2009-09-07 16:33:13,531 INFO [id: 95705166] Received queue item, processing...</div><div><br></div><div>If you see there's like a pause for a second between 10 and 12, an item gets processed pretty fast as you can see. Odd isn't it?</div> <div><br></div><div>Suhail</div><br><div class="gmail_quote">On Mon, Sep 7, 2009 at 9:32 AM, Suhail Doshi <span dir="ltr">&lt;<a href="mailto:digitalwarfare@gmail.com">digitalwarfare@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> I almost feel as though rabbitmq can't push items to my consumer fast enough, I had a backed up queue with 20 consumers and spawned another watching the items get processed and it just seemed so slow, saw numerous pauses between item processing and I don't believe it is the consumer's fault.<div> <br></div><div>I am using the Python library for the consumer part.</div><div><br></div><div><font color="#888888">Suhail</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Mon, Sep 7, 2009 at 8:23 AM, Chuck Remes <span dir="ltr">&lt;<a href="mailto:cremes.devlist@mac.com" target="_blank">cremes.devlist@mac.com</a>&gt;</span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br> On Sep 7, 2009, at 1:07 AM, aisha fenton wrote:<br> <br> &gt; Hi,<br> &gt; I'm sure I'm doing something wrong since I can't find reference to<br> &gt; this anywhere else. What I'm seeing is that the performance of<br> &gt; draining a queue gets slower as the queue size increases.<br> &gt;<br> &gt; I'm aware of the issue in RabbitMQ 1.6 that means that when it runs<br> &gt; out of physical memory that it's performance degrades because it<br> &gt; starts swapping out. But I'm not anywhere close to running out of<br> &gt; memory yet, and the degradation starts almost immediately and<br> &gt; increases linearly as the queue depth grows.<br> &gt;<br> &gt; I am publishing 500mps to an exchange. Each message is about 1KB. I<br> &gt; have a single fanout queue bound to the exchange. A single consumer is<br> &gt; popping messages off the queue.<br> &gt;<br> &gt; When the queue is less than 20,000 messages I can pop 300mps off the<br> &gt; queue. When the queue is 200,000 messages the performance drop to<br> &gt; 40-80mps.<br> &gt;<br> &gt; I'm running RabbitMQ 1.6.0. And nether rabbitmq, the consumer, or the<br> &gt; publisher are using more than 40% CPU.<br> &gt;<br> &gt; I assume I shouldn't be seeing this? Any help much appreciated.<br> <br> </div>You didn't include any code, but I'm going to take a stab in the dark<br> anyway. If you are using the ruby amqp gem you might be doing<br> 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<br> to rabbitmq each time the method is called. You are essentially<br> leaking channels all over the place every time you try to pop a new<br> message.<br> <br> If you aren't using the ruby amqp stuff, I still recommend checking<br> your code for whatever library you chose. You only need to allocate a<br> few channels and reuse them.<br> <font color="#888888"><br> cr<br> </font><div><div></div><div><br> <br> _______________________________________________<br> rabbitmq-discuss mailing list<br> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br> <a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br> </div></div></blockquote></div><br><br clear="all"><br></div></div><div class="im">-- <br><a href="http://mixpanel.com/" target="_blank">http://mixpanel.com</a><br>Blog: <a href="http://blog.mixpanel.com/" target="_blank">http://blog.mixpanel.com</a><br> </div></div> </blockquote></div><br><br clear="all"><br>-- <br><a href="http://mixpanel.com/">http://mixpanel.com</a><br>Blog: <a href="http://blog.mixpanel.com/">http://blog.mixpanel.com</a><br></blockquote></div><br></div></div></div></blockquote></div><br></body></html>