[rabbitmq-discuss] Exchange performance

Simon MacMullen simon at rabbitmq.com
Fri Jun 17 13:04:18 BST 2011

On 17/06/11 12:51, Marek Majkowski wrote:
> On Fri, Jun 17, 2011 at 12:41, Max C<maxence.cordier at gmail.com>  wrote:
>> In my application, I have a bunch of devices sendind data to a
>> rabbitMQ broker. I'm wondering if I should use 1 exchange for all my
>> devices, tagging messages with the name of the device which send
>> them ? Or if I should use 1 exchange per device.
> It all depends on how you want to use the messages. But 1 exchange
> usually should do.
> (and uses less resources than many exchanges :P)

The question of which uses less resources depends on the complexity of 
the routing logic - if your design is 1000 queues and a choice between 
either 100 direct exchanges or one headers exchange, the direct 
exchanges are likely to be faster.

But the OP said:

On 17/06/11 12:41, Max C wrote:
 > I assume it depends on how the publication process is implemented.
 > Does it instanciate 1 thread per exchange ? or does 1 thread deal with
 > all of exchanges ? Maybe this is more complicated ..

No, exchanges do not have a process associated with them at all (at 
least the four built in types don't). They're essentially just functions 
that run in the channel process, so you don't have to worry about 
exchange parallelism.

Cheers, Simon

Simon MacMullen
RabbitMQ, VMware

More information about the rabbitmq-discuss mailing list