[rabbitmq-discuss] creating connections to RMQ

Simon MacMullen simon at rabbitmq.com
Wed Feb 13 15:51:05 GMT 2013


On 13/02/13 13:18, Rob Woolfson wrote:
> What is the suggested best practice for speeding up my process?

There are several things you can do:

Creating a new connection / channel takes several network round trips - 
can you get P1 to keep a connection / channel open?

Creating a new queue is quite expensive (especially if it's durable) - 
can C1 reuse its reply queue?

Declaring / binding the queue and exchange, and consuming from the queue 
also takes some network round trips by default, since each AMQP method 
will cause a corresponding -ok method to be sent back. To eliminate the 
round trips you can use the nowait parameter to declare / bind / consume 
- this prevents an -ok method from coming back, so all the requests can 
be pipelined. Alternatively if your reply queue is reused you can skip 
redeclaring it each time, just declare it and consume from it once.

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list