[rabbitmq-discuss] RabbitMQ cluster and connection management
mcintoshj at gmail.com
Wed Mar 12 16:09:46 GMT 2014
haproxy is a common method that you can play with via software, F5 load
balancers for hardware, pretty much any standard balancer will work. Heck
I'd imagine you could almost use apache httpd and proxy support to do this.
They just have to be configured correctly and then choose your load
balancing mechanism appropriately, and support a lower level tcp/ip
connection since the AMQP protocol is NOT http (we hit this initially until
networking realized that these aren't short lived simple http connections).
Though beware, if you use a feature most load balancers have of monitoring
the back end through tcp/ip connects to the port (5672), you'll have a LOT
of messages in your log files where you'll see what are essentially half
opened connections to Rabbit. This is pretty normal though as the load
balancers aren't trying to really connect, just verify that the port is
still open before rerouting traffic to a different node.
A lot of these kinds of decisions tend to be organization specific. Does
your organization use physical load balancers everywhere and have good
policies in place to use them, or do most people have software load
balancers, cloud load balancers, etc.
We use F5 LTM's ourselves, with a least open connections algorithm I
believe (might be a round robin though - I don't recall immediately). It's
worked pretty reliably, once we set the load balancer to not reap
connections until 615 seconds have passed (default heartbeat in rabbit was
600 seconds as I recall).
On Wed, Mar 12, 2014 at 1:28 AM, Michael Klishin <mklishin at gopivotal.com>wrote:
> On 12 Mar 2014, at 08:41, lcassa8 at gmail.com wrote:
> > I created 3 server cluster of RabbitMQ. As per documentation, RabbitMQ
> client code does not support connection management to the cluster. It only
> connects to one broker at a time. I wanted to find out that in order to
> distribute load what usualy people do for RabbitMQ.
> Any strategy that achieves a reasonably even distribution. Picking a
> random node will
> likely be good enough for many environments.
> > Do you use simple Load Balacer or write your own code to manage
> connections, connection pooling etc?
> It's a common strategy to use a load balancer in front of a cluster and
> make clients connect to it. Note that
> you may need more than one load balancer and clients need to be able to
> connect to the first reachable one.
> If you use RabbitMQ Java client, it can connect to the first reachable
> node from a list.
> Software Engineer, Pivotal/RabbitMQ
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss