[rabbitmq-discuss] Poor performance when sending specific characters

Gavin M. Roy gmr at meetme.com
Mon Nov 19 23:15:32 GMT 2012


On Mon, Nov 19, 2012 at 4:22 PM, Alvaro Videla <videlalvaro at gmail.com>wrote:

> I just tried publishing those characters in PHP and I've got 4000 msgs
> published in 1.2 seconds


In that spirit, mind you this was on my laptop (Python 2.7.2, RabbitMQ
3.0.0, Pika 0.9.8):

*send.py*

import pika
import time

ITERATIONS = 10000

connection = pika.BlockingConnection()
channel = connection.channel()
start_time = time.time()

for x in range(0, ITERATIONS):
    channel.basic_publish(exchange='test',
                          routing_key='test',
                          body='Are these characters slow? !@$%^&*!',

properties=pika.BasicProperties(content_type='text/plain',
                                                          app_id='test',

timestamp=int(time.time()),
                                                          delivery_mode=1))
duration = time.time() - start_time
print "Published %i messages in %.4f seconds (%.2f messages per second)" %
(ITERATIONS, duration, (ITERATIONS/duration))


*Output:*

Published 10000 messages in 9.3243 seconds (1072.47 messages per second)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121119/9ea9c88a/attachment.htm>


More information about the rabbitmq-discuss mailing list