[rabbitmq-discuss] Newbie Questions

Simon MacMullen simon at rabbitmq.com
Fri Nov 11 13:04:08 GMT 2011

On 10/11/11 22:58, Matthew Evans wrote:
> 1) Can the Erlang application(s) reside on the same VM as RabbitMQ? Is
> this recommended? In this case the Erlang app will have a NIF, and could
> be quite busy. How would you go about deploying this, can you just
> create an Erlang ez file and have RabbitMQ load it?

Yes, a RabbitMQ plugin is just an OTP application packaged as a .ez file.

So you can load your apps into the same VM as RabbitMQ. Obviously you 
have to trust them not to crash the VM.

One thing you should maybe be aware of is that when using the direct 
client there's no equivalent to the TCP backpressure we exert on network 
clients when the server starts to run out of memory.

> 2) What is a typical configuration: Many exchanges, few queues? Or few
> exchanges with many queues? What are the rules of thumb in deciding how
> the exchange/queue layout is modeled?

The usual rule of thumb is whatever makes sense for your app.

In general the cost of an exchange tends to be *usually* not worth 
bothering with. Queues are slightly more expensive (although it's still 
sane to have tens of thousands of them or even more in some circumstances).

Each queue is a single process, so if you have too few queues you might 
not get all the parallelism you might want.

> 3) What are the performance hits in using external exchanges?

If you mean the external-exchange plugin, fairly huge. Every routing 
decision gets converted into a couple of messages getting sent over the 
network. And it's a single process per node too.

But if you mean writing your own exchange type plugin in Erlang, 
basically free except you might not be as efficient as we are :-) - the 
built-in exchange types are essentially "internal" plugins.

> 4) Can a queue be on a different node than an exchange?

Exchanges only exist in Mnesia, and are therefore always on every node 
at once.

> 5) This may sound like a really simple question, but I'm struggling with
> the idea of a broker. Is a broker a combination of exchange + queues, or
> is it a set of exchanges on the same Erlang VM?

A broker is just another word for "RabbitMQ server".

Cheers, Simon

Simon MacMullen
RabbitMQ, VMware

More information about the rabbitmq-discuss mailing list