[rabbitmq-discuss] Connection and Channel lifecycle

Alexandru Scvorţov alexandru at rabbitmq.com
Wed Dec 21 18:42:42 GMT 2011


Hi Adam,

Sorry for the late response.

> For example, say I have a "worker pool" with 40
> QueueingConsumers (ie 40 separate channels).  I believe it is
> completely fine to keep these channels (and underlying connection(s))
> open indefinitely, is this correct? 

It probably is.  Channels don't require a lot of resources to keep
running, on neither the server nor the client side.

> In this long-running situation,
> what is the optimal number of underlying connections for these 40
> channels? 

We did some tests a while ago and we couldn't find much difference in
throughput between running multiple channels on a single connection or on
multiple connections.

Note that connections use up the limited file descriptors, so you
wouldn't be able to run a very large number of connections at the same
time.

I suspect it's better (and easier) to have all the channels running on
the same connection.

Hope this clears things up.

Cheers,
Alex

On Fri, Dec 16, 2011 at 05:25:50PM -0500, Adam Rabung wrote:
> Hello,
> I've been reading up on this quite a bit, but I'm still unclear about
> some general principles of how to use connections and channels
> correctly.  For example, say I have a "worker pool" with 40
> QueueingConsumers (ie 40 separate channels).  I believe it is
> completely fine to keep these channels (and underlying connection(s))
> open indefinitely, is this correct?  In this long-running situation,
> what is the optimal number of underlying connections for these 40
> channels?  I believe from a throughput standpoint, the answer might be
> 40.  From a resource conservation standpoint, the answer would be 1.
> I will have many of these worker pools, so both considerations are
> important.  Can someone give pointers on how to balance those two
> concerns?
> 
> Does anyone use connection or channel pooling?
> 
> Any pointers much appreciated,
> Adam
> 
> PS. Thanks for great answers to all of my crazy questions so far!
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list