<br><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 19, 2012 at 4:22 PM, Alvaro Videla <span dir="ltr"><<a href="mailto:videlalvaro@gmail.com" target="_blank">videlalvaro@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I just tried publishing those characters in PHP and I've got 4000 msgs published in 1.2 seconds</blockquote>
<div><br></div><div>In that spirit, mind you this was on my laptop (Python 2.7.2, RabbitMQ 3.0.0, Pika 0.9.8):</div><div><br></div><div><b>send.py</b></div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">import pika</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">import time</font></div>
</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace"><br></font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">ITERATIONS = 10000</font></div>
</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace"><br></font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">connection = pika.BlockingConnection()</font></div>
</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">channel = connection.channel()</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote">
<div><div><font face="courier new, monospace">start_time = time.time()</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace"><br></font></div></div>
</div>
</div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">for x in range(0, ITERATIONS):</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>
<font face="courier new, monospace"> channel.basic_publish(exchange='test',</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace"> routing_key='test',</font></div>
</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace"> body='Are these characters slow? !@$%^&*!',</font></div></div></div>
</div>
<div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace"> properties=pika.BasicProperties(content_type='text/plain',</font></div></div></div></div><div class="gmail_extra">
<div class="gmail_quote"><div><div><font face="courier new, monospace"> app_id='test',</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote">
<div><div><font face="courier new, monospace"> timestamp=int(time.time()),</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div>
<font face="courier new, monospace"> delivery_mode=1))</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><div><font face="courier new, monospace">duration = time.time() - start_time</font></div>
</div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="courier new, monospace">print "Published %i messages in %.4f seconds (%.2f messages per second)" % (ITERATIONS, duration, (ITERATIONS/duration))</font></div>
</div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div><b>Output:</b></div><div><br>Published 10000 messages in 9.3243 seconds (1072.47 messages per second)<br></div><div><br>
</div><div><br></div></div>
</div>