python - Sleep takes 86% of time in rabbitpy consumer? -


i found rather interesting problem today. have queue 2k messages in it. consumer:

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() 
takes 41 seconds these messages , 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.)

zoomed in screenshot the culprit found profiler


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -