ceps icon indicating copy to clipboard operation
ceps copied to clipboard

AMQP, disable connection pooling

Open carlhoerberg opened this issue 7 years ago • 2 comments

Default to broker_pool_limit = 1. There is no point in having many connections to a RabbitMQ server from a single process. Instead each worker/thread should have their own channel.

carlhoerberg avatar Feb 14 '18 16:02 carlhoerberg

Can you elaborate further about this? I for one am not as knowledgeable about the problem area.

Why would each sub-process want their own channel? If I'm reading right. Not sure about the worker/thread definition here, too (sub-process/coroutine?).

jheld avatar Aug 19 '19 03:08 jheld

Unfortunately for us, our AMQP client is not threadsafe. We will have to prototype and figure out how this is going to work. In addition, there's a maximum amount of channels on each connection. It's rather large so it's not usually a problem but users do unexpected things.

The real advantage of using multiple connection is avoiding locks and paralleling the output of messages. Channels only multiplex messages over a single connection. Sometimes that's too slow for the throughput you are after.

thedrow avatar Aug 19 '19 11:08 thedrow