<div><div class="gmail_quote">On Thu, Apr 21, 2011 at 3:07 PM, Matthias Radestock <span dir="ltr">&lt;<a href="mailto:matthias@rabbitmq.com">matthias@rabbitmq.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Shalin,<br>
<br>
Shalin Shekhar Mangar wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The rate of consumption keeps dropping. CPU usage of rabbitmq is constant at approx 170%. [...] Am I doing something wrong?<br>
</blockquote>
<br>
Yes, you are :)<br>
<br>
In <a href="https://gist.github.com/935196#L85" target="_blank">https://gist.github.com/935196#L85</a> you are creating a new AMQP consumer every time you want to receive a message from the queue. Simply move that line out of the loop.<br>
</blockquote><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8">Thanks Matthias!<div><br></div><div>I moved that out of the loop and here are the numbers running the test again:</div><div><br>
</div><div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 210443 throughput: 20716.97184485135</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 119824 throughput: 11796.022839141564</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 444574 throughput: 22054.46968945332</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 244677 throughput: 12137.960115090782</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 700164 throughput: 23215.756490599822</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 360837 throughput: 11964.488212473889</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 931030 throughput: 23183.59520904405</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 476592 throughput: 11867.626185911004</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 1183641 throughput: 23597.779062580994</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 590305 throughput: 11768.675611555254</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 1427614 throughput: 23730.28590425532</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 702821 throughput: 11682.529920212766</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 1667459 throughput: 23766.51938426454</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 803325 throughput: 11449.900228050172</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 1905431 throughput: 23770.346806387228</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 913091 throughput: 11390.855788423154</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 2154468 throughput: 23896.051464063887</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 1017438 throughput: 11284.80479148181</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 2359715 throughput: 23559.21965635327</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 1129760 throughput: 11279.440101436687</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Produced: 2587303 throughput: 23486.560579515437</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>Consumed: 1232315 throughput: 11186.490681820245</div>
<div><br></div></div><div>The consumption rate holds throughout the test but it still seems low to me. I&#39;d think that for such a small message payload, a single box should be able to do much more than these. Is there something else that I should do to get better performance out of a single box?</div>
<div><br></div><div>-- </div></div>Regards,<br>Shalin Shekhar Mangar.<br>
</div>