[rabbitmq-discuss] Extremely slow responses
Marek Majkowski
majek04 at gmail.com
Tue Jan 25 10:53:48 GMT 2011
Hi,
> I'm getting weird problem with very slow transfers of messages to reply
> queue.
>
> The setup: cluster of 3 nodes, with fanout-type exchange, with 3 queues
> bound, one per each node.
>
> This part works without problems (tested separately) - messages sent
> from client get delivered quickly to each queue and are then read by
> servers on each node.
>
> However, when I add callback queue (with exclusive=True) for responses
> from each server, I'm getting responses back very slowly - like after a
> minute!
>
> (the callback queue gets created by client with
> channel.queue_declare(exclusive=True) )
>
> Basically, I combined solutions from tutorial on fanout
> (http://www.rabbitmq.com/tutorial-three-python.html) with code from
> tutorial on RPC (http://www.rabbitmq.com/tutorial-six-python.html) and
> used it in a cluster.
>
> 1. Might it be that temporary queues get propagated across cluster very
> slowly?
>
> 2. Or is it a problem that I do not bind the reply temp queue to any
> exchange? (ch.basic_publish(exchange='', routing_key=props.reply_to,
> body = result))
>
> I'm using pika for both server and client.
>
> Rationale for the whole thing: I need to replicate the same JSON-RPC
> call across several nodes. At best, I would like to be able to read all
> the produced responses back.
In the server code you're not using acks:
chan.basic_consume(on_request, queue=mynode, no_ack=True)
but later on you call basic_ack:
ch.basic_ack(delivery_tag = method.delivery_tag)
That's rather bad.
Also, rate limit using basic_qos, doesn't make much sense with no_ack=True:
chan.basic_qos(prefetch_count=1)
And the last thing: clustering != HA.
Clustering doesn't mean that the messages are replicated.
Every queue 'lives' on a single node, if that node goes down,
that queue goes down.
Cheers!
Marek
More information about the rabbitmq-discuss
mailing list