RabbitMQ 3.7 connection limits

363 views
Skip to first unread message

Dmitry Andrianov

unread,
Apr 10, 2018, 7:57:41 PM4/10/18
to rabbitmq-users
Hello.
A question regarding per-vhost limits ( http://www.rabbitmq.com/vhosts.html ).
So in 3.7 we can limit total number of concurrent connections for a broker. But what exactly happens when the limit is reached?
Does RabbitMQ stop accepting more? Or does it accept and drop them immediately? Or something else?
How does it look from client's perspective? Does it get a failure quickly or the connection attempt just times out?

Put differently - is it a good replacement for ipfilter/conntrack based connection limiter?
If RabbitMQ keeps accepting new connections and does anything at all to them - that probably means it keeps using more resources (especially if these are SSL connections) and so it cannot be used as a reliable mechanism of preventing a possible overload and crash?

Thanks

Michael Klishin

unread,
Apr 10, 2018, 10:17:48 PM4/10/18
to rabbitm...@googlegroups.com
You can limit the max number of connections per vhost. Note that tests that connect in a tight loop
can exceed that value somewhat but in practice it won't be a problem.

When the limit is reached, no more connections will be accepted with appropriate messages logged by the node.

If your goal is to limit the number of connections to the entire node, I'd definitely stick to conntrack or proxy limits or similar.
This feature was introduced primarily for limiting the number of connections in a specific vhost, which is important
when a RabbitMQ node/cluster is offered as a multi-tenant service to N parties.


hivehome.com



Hive | London | Cambridge | Houston | Toronto
The information contained in or attached to this email is confidential and intended only for the use of the individual(s) to which it is addressed. It may contain information which is confidential and/or covered by legal professional or other privilege. The views expressed in this email are not necessarily the views of Centrica plc, and the company, its directors, officers or employees make no representation or accept any liability for their accuracy or completeness unless expressly stated to the contrary. 
Centrica Hive Limited (company no: 5782908), registered in England and Wales with its registered office at Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Dmitry Andrianov

unread,
Apr 14, 2018, 7:52:30 AM4/14/18
to rabbitmq-users
Understood, will stick to conntrack, thanks.

Out of curiosity - do you have any plans for the global limit? As a resource exhaustion prevention.

Cheers
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Apr 14, 2018, 8:15:00 AM4/14/18
to rabbitm...@googlegroups.com
There's already plenty of tools (including a setting in Ranch) that can be used to limit the total number of connections.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dmitry Andrianov

unread,
Apr 14, 2018, 8:19:07 AM4/14/18
to rabbitmq-users
Do you have an example by any chance how to limit it in ranch via RabbitMQ config?
Cheers

Michael Klishin

unread,
Apr 14, 2018, 8:21:37 AM4/14/18
to rabbitm...@googlegroups.com
It's not a documented feature and up until a few days ago I wasn't aware of it myself.

It's `rabbit.connection_max` [1].
We are not yet sure whether it should be exposed to the users and what values should plugins such as Web MQTT and Web STOMP use [2].


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages