Skip to content

Improve connection limits, introduce per-protocol connection limits #16347

Description

@michaelklishin

This is an umbrella issue for a number of closely related discussions on the limits RabbitMQ supports or should support with @the-mikedavis @ansd @acogoluegnes.

Problem Definition

The VMware, Inc. part of the core team proposes reviewing our limits to eventually (likely before 4.4.0) converge on the following limits design/structure/separation:

  1. Per-user and per-virtual host apply to all protocols
  2. connection_max covers core protocols (AMQP 1.0, AMQP 0-9-1)
  3. {plugin}.connection_max covers each plugin protocol, including their Protocol-over-WebSockets variants, so mqtt.connections_max will cover both MQTT and MQTT-over-WebSockets

Note that most of this design is already in place but given the number of limits and protocols RabbitMQ supports, we need to review that nothing is missing, in particular for the per-user and per-virtual host limits.

HTTP API

If we put the WebSockets-based protocols aside, the HTTP API is not really covered by the above limits and given the request-oriented nature of HTTP (even with persistent connections, even with HTTP/2, HTTP/3), the protective measure here is a Ranch-level connection limit introduced in #7753, #7593.

Tanzu RabbitMQ Protocols

connections_max should cover AMQP 1.0-over-Websockets since its a WebSocket variant of the core protocols.

Remaining Items as a TODO List

Activity

  1. added this to the 4.4.0 milestone on May 7, 2026
  2. michaelklishin commented on May 8, 2026

    @michaelklishin
    CollaboratorAuthor

    I did a review of what's left to be done in this area.

    What Does not Match the Plan

    1. STOMP and Web-STOMP do not enforce the per-user connection limit
    2. MQTT has no mqtt.connections_max (which is expected, we have barely started on the per-protocol limits)
    3. STOMP: no stomp.connections_max (ditto)
    4. Naming inconsistency: the core and stream use connection_max, stream.connection_max but Web MQTT, Web STOMP use {plugin}.max_connections
    5. Web MQTT, Web STOMP use a separate Ranch counter (see 2, 3), so maybe using separate limits for them would be an acceptable way
    6. Management plugin does not have a *.max_connections equivalent
      Ranch knob.

    What is Already Covered

    • Per-virtual host limit is enforced in AMQP 0-9-1, AMQP 1.0, MQTT, STOMP, RabbitMQ Stream Protocol, and the direct Erlang client
    • Per-user limit is enforced in AMQP 0-9-1, AMQP 1.0, MQTT, RabbitMQ Stream Protocol, amd tje direct Erlang client (so, only STOMP is missing)

    Related Limits (for Completeness' Sake)

    • Max channel limits are fully implemented, there's seemingly nothing to do
    • default_limits.vhosts.$id.max_queues covers queue counts per virtual host
  3. michaelklishin commented on May 8, 2026

    @michaelklishin
    CollaboratorAuthor

    For naming consistency, we should rename stream.connection_max to stream.max_connections (to match Web STOMP, Web MQTT that have already shipped) and if we want, bump Cuttlefish and adopt this key aliasing feature that was introduced specifically for basckwards-compatible renaming, deprecations.

    We can support both {plugin}.max_connections and {plugin}.connection_max, and even alias the core connection_max as max_connections for consistency.

  4. michaelklishin commented on May 8, 2026

    @michaelklishin
    CollaboratorAuthor

    @the-mikedavis would you have some cycles to begin working on the TODO items on the list above?

    We can start with a new Cuttlefish release (3.7.0), then Cuttlefish bump in RabbitMQ (with backports to v4.2.x), renaming of stream.connection_max with aliasing, and then the gaps, per-protocol limits.

  5. 10 remaining items

  6. added a commit that references this issue on May 12, 2026
  7. michaelklishin commented on May 13, 2026

    @michaelklishin
    CollaboratorAuthor

    @the-mikedavis let me know if this roughly matches what you had in mind w.r.t. per-protocol limits.

  8. the-mikedavis commented on May 19, 2026

    @the-mikedavis
    Collaborator

    This looks great, thank you @michaelklishin & @lukebakken !

    (Sorry for the late reply, been busy 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions