[rabbitmq-discuss] What is a good tradeoff for number of connections and channels/connection for a client ?

Matthew Sackman matthew at rabbitmq.com
Mon Jul 26 16:30:12 BST 2010


On Thu, Jul 22, 2010 at 10:51:25PM +0530, Arun Suresh wrote:
> So is it safe for me to assume, that like Alex mentioned, there should NOT
> be any issue if I create ALL the channels on the same connection ?

There should be no issues. AMQP allows up to 16384 channels per
connection (though one is the magic channel 0, so you actually get 16383
"normal" channels to use), as this transcript from the erlang client
shows:

rabbitmq-erlang-client$ ERL_LIBS=deps:dist erl -pa ebin ../rabbitmq-server/ebin test +P 1000000
Erlang R14A (erts-5.8) [source] [64-bit] [smp:8:8] [rq:8]
[async-threads:0] [kernel-poll:false]

Eshell V5.8  (abort with ^G)
1> Conn = amqp_connection:start_network_link().

=INFO REPORT==== 26-Jul-2010::16:28:45 ===
Negotiated maximums: (Channel = 0, Frame= 131072, Heartbeat=0)
<0.34.0>
2> [amqp_connection:open_channel(Conn) || _ <- lists:seq(1,16383)].
[<0.42.0>,<0.45.0>,<0.48.0>,<0.51.0>,<0.54.0>,<0.57.0>,
 <0.60.0>,<0.63.0>,<0.66.0>,<0.69.0>,<0.72.0>,<0.75.0>,
 <0.78.0>,<0.81.0>,<0.84.0>,<0.87.0>,<0.90.0>,<0.93.0>,
 <0.96.0>,<0.99.0>,<0.102.0>,<0.105.0>,<0.108.0>,<0.111.0>,
 <0.114.0>,<0.117.0>,<0.120.0>,<0.123.0>,<0.126.0>|...]

Matthew


More information about the rabbitmq-discuss mailing list