Skip to content

Instantly share code, notes, and snippets.

@sheki
Created August 9, 2011 13:01
Show Gist options
  • Select an option

  • Save sheki/1133975 to your computer and use it in GitHub Desktop.

Select an option

Save sheki/1133975 to your computer and use it in GitHub Desktop.
RabbitMQ conversation about channels and conversations
shekispeaks: why should I multiplex Multiple AMQP sessions over a single connection and how many concurrent channels can a connections support without any performance degradation.
[2:45pm] shekispeaks: ?
[2:48pm] bob2351: Bob_: yes, all the released code for rabbit, including mgmt is open source
[2:50pm] Bob_: ok, thanks for your help!
[2:50pm] shekispeaks: any help on using RabbitMQ connections?
[2:55pm] aib_007 joined the chat room.
[3:38pm] [diablo] joined the chat room.
[3:57pm] Espen-_- left the chat room. (Excess Flood)
[4:02pm] Espen-_- joined the chat room.
[4:03pm] Espen-_- left the chat room.
[4:13pm] arreyder left the chat room. (Changing host)
[4:13pm] arreyder joined the chat room.
[4:21pm] jonesy left the chat room. (Quit: Leaving...)
[4:32pm] workbean left the chat room. (Ping timeout: 252 seconds)
[4:41pm] rberger left the chat room. (Ping timeout: 252 seconds)
[4:47pm] rberger joined the chat room.
[5:05pm] jonesy joined the chat room.
[5:26pm] Bob_ left the chat room. (Quit: Page closed)
[5:36pm] Urocyon joined the chat room.
[5:52pm] antares_zzzz is now known as antares_.
[5:53pm] antares_: shekispeaks: every amqp connection = 1 open tcp connection
[5:54pm] antares_: shekispeaks: those take OS resource and you cannot typically open thousands of them with default setting. Channels (or connections if channels did not exist) should not be shared between threads/processes/fibers and so on.
[5:54pm] antares_: shekispeaks: maybe read http://bit.ly/amqp-model-explained
[5:56pm] workbean joined the chat room.
[5:56pm] antares_: shekispeaks: connections have limit on number of channels that clients negotiation with the broker. It is often set to thousands (65536 and so on), technically the limit is much higher because channel is just an integer sent with the rest of the data.
[5:58pm] You left the chat by being disconnected from the server.
[5:58pm] You rejoined the room.
[5:58pm] antares_: shekispeaks: I hope this helps
[5:59pm] shekispeaks: antares_
[6:01pm] shekispeaks: antares: thanks helps a lot. But I want to know performance wise, how many channels can multiplex on a connection w/o any performance degradation. I am writing an app with a max of 200 threads. So I think creating a pool of 200 Connections is a good approach .. any opinions
[6:01pm] Jaymin left the chat room. (Ping timeout: 260 seconds)
[6:02pm] antares_: shekispeaks: there is no reason to create 200 connections if just 1 is sufficient
[6:02pm] shekispeaks: i.e is a single tcp connection.
[6:03pm] antares_: shekispeaks: 200 channels is certainly not a problem. 2000 is OK.
[6:03pm] shekispeaks: will not 200 channels on a single TCP conn. be slower than 200 TCP Conn. ~ more parallel.
[6:03pm] shekispeaks: is something wrong in my assumption?
[6:07pm] antares_: shekispeaks: what kind performance requirements are we talking about?
[6:08pm] shekispeaks: reading messages from queues of size ~1mb.
[6:08pm] antares_: shekispeaks: 1 TCP connection with 200 channels will work just as fine as 200 TCP connections but will consume less OS resources.
[6:08pm] antares_: and how many per second?
[6:09pm] antares_: I am afraid your bottleneck will be how fast your consumer app can keep up with those messages
[6:09pm] antares_: not channels vs consumers
[6:09pm] antares_: so I would rather not optimize based on guesses but make things work first and then profile
[6:13pm] antares_: *channels vs connections
[6:26pm] shekispeaks: my consumer app is just a proxy it can keep up with how many our RabbitMQ can provide me.
[6:27pm] antares_: shekispeaks: if you are just proxying then tuning your TCP stack settings will probably have greater effect than using connections vs channels
[6:30pm] shekispeaks: not convinced let me run a few tests and check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment