amqproxy icon indicating copy to clipboard operation
amqproxy copied to clipboard

Configure max connections to upstream

Open jlindenbaum opened this issue 3 years ago • 2 comments

We run a PHP application that communicates to Rabbit through AMQProxy.

Recently we observed a failure mode we believe could be mitigated if AMQProxy allowed a configuration of the connection pool to fail incoming connections if the pool is at its maximum, and no existing connection can be reused. Effectively system protection.

This is similar behaviour we configure in ProxySQL to protect upstream databases from being overloaded.

Should an event occur where the system load increases such that our upstream Rabbit would be put in danger, we'd rather fail a small percentage of our incoming requests, rather than have the entire application degrade.

Going through the source in the pool class there does not appear to currently exist a flag to do this. I'd be happy to contribute this functionality, but I want to ensure this would be acceptable for the project.

jlindenbaum avatar Jan 06 '23 14:01 jlindenbaum

Yes, it's something we would accept

On Fri, 6 Jan 2023, 15:26 Johannes Lindenbaum, @.***> wrote:

We run a PHP application that communicates to Rabbit through AMQProxy.

Recently we observed a failure mode we believe could be mitigated if AMQProxy allowed a configuration of the connection pool to fail incoming connections if the pool is at its maximum, and no existing connection can be reused. Effectively system protection.

This is similar behaviour we configure in ProxySQL to protect upstream databases from being overloaded.

Should an event occur where the system load increases such that our upstream Rabbit would be put in danger, we'd rather fail a small percentage of our incoming requests, rather than have the entire application degrade.

Going through the source in the pool class there does not appear to currently exist a flag to do this. I'd be happy to contribute this functionality, but I want to ensure this would be acceptable for the project.

— Reply to this email directly, view it on GitHub https://github.com/cloudamqp/amqproxy/issues/97, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABL6TSCL7M4TYFVC2OXH43WRATRTANCNFSM6AAAAAATTEFWVI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

carlhoerberg avatar Jan 07 '23 09:01 carlhoerberg

With v2.0.0 we do channel pooling, and the number of upstream connections are vastly lower now (we use up to channel_max channels of each upstream connection).

carlhoerberg avatar Mar 28 '24 00:03 carlhoerberg