Very slow publish rate (only 17 messages/sec) when using delivery confirmation on Pika

641 views
Skip to first unread message

compu...@gmail.com

unread,
Oct 8, 2015, 10:56:15 PM10/8/15
to rabbitmq-users
Hi All,

I am getting a very slow publish rate (only 17 messages/sec) when using delivery confirmation on Pika. Without delivery confirmation (just commenting out channel.confirm_delivery()), the publish rate is 16K messages/sec. I am using a single publisher and RabbitMQ v3.5.5. This is the example code I am using to publish the messages:

import pika

connection
= pika.BlockingConnection()

channel
= connection.channel()

channel
.queue_declare(queue='myqueue', durable=True)

channel
.confirm_delivery()

message
= ' '.join(sys.argv[1:]) or "Hello World!"

for i in range(1, 10000000):
    channel
.basic_publish(exchange='myexchange',
                          routing_key
='myqueue',
                          body
=message,
                          properties
=pika.BasicProperties(
                                     delivery_mode
= 2,),
                                     mandatory
=True)

connection
.close()


Am I doing something wrong? Can I achieve higher publish rates using Pika?

Thanks!

Michael Klishin

unread,
Oct 9, 2015, 3:01:59 AM10/9/15
to rabbitm...@googlegroups.com
This is quite even for the pathological "publish and wait for a confirm" for every message.

See if Pika supports streaming confirms (callbacks) or use a blocking method after publishing a batch of messages.
Reply all
Reply to author
Forward
0 new messages