[rabbitmq-discuss] Best practices for setting up exchanges & queues for multi-tenancy.

Emile Joubert emile at rabbitmq.com
Fri Dec 24 09:43:01 GMT 2010

Hi Filbar,

Op 23/12/2010 19:53, het Filbar geskryf:
> Hello,
> I have been unable to find information on the best way to layout
> virtual machines and exchanges for multi-tenant web apps.  If I have
> missed something obvious please direct me to the docs.  I am building
> a multi-tenant web app that needs to talk to computers/devices on the
> client's LAN.  Each client will have 4-20 devices and there will be
> about 100,000 clients and needs to scale to 1,000,000.
> My understanding is that different clients should be on different
> virtual machines in order to protect exchanges and queues, but this
> seems overkill for 4-20 exchanges/queues per VM.  The next best
> solution seems to use one exchange per client and each of the
> applications can have it's own queue.  What is the best way to handle
> this so that the application can scale as the number of users grows?

There are a few ways you can isolate clients. Assigning a virtual 
machine to each client incurs alot of overhead, but gives you 
flexibility in resource allocation.

You could also run multiple separate RabbitMQ brokers on the same OS and 
use a different port for each of them. This still involves alot of 
overhead because each client has its own Erlang node, but you still have 
some resource allocation flexibility, e.g. using ulimits.

Probably the most suitable option is to set up a single broker and 
assign an AMQP vhost to each client. This offers the least overhead and 
the least resource isolation. You can use clustering to add capacity in 
line with user growth.



More information about the rabbitmq-discuss mailing list