[rabbitmq-discuss] maximum number of amqp connections to a rabbitmq broker

Chris Chew chrisch at ecollege.com
Tue May 31 00:12:23 BST 2011


Hi Dhinesh.

> Matthew Sackman [matthew at rabbitmq.com]
> Sent: Monday, May 30, 2011 8:14 AM
> To: rabbitmq-discuss at lists.rabbitmq.com
> Subject: Re: [rabbitmq-discuss] maximum number of amqp connections to a rabbitmq broker
> 
> On Mon, May 30, 2011 at 06:19:47PM +0530, Dhinesh Kumar wrote:
> > I am trying to find the maximum number of amqp connections i can establish
> > with a RabbitMQ broker running on Ubuntu.
> > I tried both Java and erlang client to create connections but i could not
> > succeed more than 829 connections.
> >
> > I like to know how can i increase the number ??

> You're likely hitting the ulimit. Edit /etc/security/limits.conf and
> allow the rabbitmq user to have a much higher "nofile" setting. Rabbit
> will log on start up how many sockets it's permitting, so once the
> change has taken effect and you've restarted rabbit, you should find log
> entries to demonstrate it's working.

Assuming the connections are all coming from a single client machine, you'll also have to do complimentary tuning on the client side.  Increase the ulimit if the client is unix-based, and on any OS increase the ephemeral port range to be more than the number of connections you are targeting.

Also, if your client is Java-based then you'll need to tune the memory and Garbage Collection settings so that your client JVM can manage the connections.  Java reserves several KB of memory per socket connection...which means you'll run out of memory in a JVM with standard settings before you max out the Rabbit service (after ulimit is set per Matthew's suggestion, of course).

-Chris 


More information about the rabbitmq-discuss mailing list