[rabbitmq-discuss] (pika) slow asyncore loop?

Marcin Krol mrkafk at gmail.com
Tue Jan 25 20:36:58 GMT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Apparently I'm having RPC responses coming back to client before
asyncore loop in pika can react. It reacts later, but slowly, like 20-30
seconds later than callbacks happen.

Setup: rpc client sends a message to fanout exchange, gets 3 replies
from 3 servers back. That is not a problem.

The thing is, callbacks apparently happen before asyncore loop can do
another iteration.

Loop:

while respnum < servnum:
        pika.asyncore_loop(count=1)
        respnum += 1
        print 'respnum', respnum, 'at',
datetime.datetime.now().strftime('%H:%S')


Output from client:
 . sending  hello 20:23 at 20:23
#### (below is callback output ####
 . recvd  echo: hello 20:23 at 20:23
 . recvd  echo: hello 20:23 at 20:23
 . recvd  echo: hello 20:23 at 20:23
#### below there's output produced while exiting and entering asyncore
loop ####
respnum 1 at 20:23
respnum 2 at 20:53
respnum 3 at 20:23

2nd iteration of asyncore loop happened 20 seconds later than callback
(. recvd) happened.

Is there any way to deal with it, other than rather naive solutions like
delaying basic_publish in server?



Server code:

http://pastie.org/pastes/1497146/text

Client code:

http://pastie.org/pastes/1497144/text

- --

Regards,
mk

- --
Premature optimization is the root of all fun.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNPzRqAAoJEFMgHzhQQ7hO/IQH/3F6LtLungt7tj3j5DD8tICe
CYr7LppIFPUrWiVialnhai2OaQNzM217Fexd7SGAhW90ixX7Bl3n5n7Rq0CgjyGn
h92/N4AlyqeXxQvhefgBtt54TXHMpgMhJcyqzOBh6B/pxEia5MjeNLIWf6KwJwmH
aiv4FjJsN3Ba6GrVhhM2r2WoYj17mTN9jZg+RA29KrMINW3q9isJUy005uMJ+kn2
Liy4Fs/iOctMH0npdQaANL8zjfYbd5i7DGbn4Z/u1i5dvZ5ZHH4oJiswzqRPlxSz
P8k0n0F8xSCLWxWUBOx6sWO2p7L+0tG4cGkWrSjI4/dELUKbEbwmSukS60+bXWY=
=vzB/
-----END PGP SIGNATURE-----


More information about the rabbitmq-discuss mailing list