python - Sleep takes 86% of time in rabbitpy consumer? -
i found rather interesting problem today. have queue 2k messages in it. consumer:
takes 41 seconds these messages , import rabbitpy rabbitpy.connection('amqp://guest:guest@localhost:5672/%2f') conn: conn.channel() channel: queue = rabbitpy.queue(channel, 'example') message in queue.consume_messages(): message.ack()
ack
them. (messages vary 4kb 52kb
) publisher, however, took 15 seconds publish them.
upon profiling, found there call sleep
spend 86% of time. this, application, not acceptable. me rid of sleep? (i'm ok if cpu cycles wasted or whatever till message arrives.)
Comments
Post a Comment