[rabbitmq-discuss] Multiple connections performance
Tim Watson
tim at rabbitmq.com
Tue Mar 5 14:41:10 GMT 2013
Hi Artur
On 5 Mar 2013, at 12:43, rabbit15 wrote:
> Hi, could you tell me why many connections are faster than one connection ?
If your server is processing multiple connections concurrently then it is possible that you will be able to take advantage of parallelism and gain a performance boost. This may *not* happen of course, if for example the connections are writing to the same queue (in which case input has to be serialised), so it depends on how your application(s) will be structured and the topology your using and so on.
> I read that better is to use many channels, but only one connection.
Connections are much more resource intensive that channels, both on the client and the server. Connection use constrained resources (i.e., file descriptors) which channels do not. Multiplexing channels over a single connections is pretty much transparent to the application. Connections which are publishing can become blocked when the server is overloaded (i.e., hits the memory high watermark) however, so if you're publishing and consuming in the same client application then using separate connections might be advantageous (so that flow control doesn't block the consumer).
Cheers,
Tim
More information about the rabbitmq-discuss
mailing list