BlogRabbitMQ

RabbitMQ Memory High Watermark and Flow Control: Why Publishers Block

Scott Sternloff

By Scott Sternloff, Senior Enterprise Architect

LinkedIn · Updated · 5 min read

RabbitMQ Memory High Watermark and Flow Control: Why Publishers Block
On this page

Short answer

RabbitMQ blocks publishing connections on every node when one node's memory passes its high watermark, which defaults to 60% of detected RAM. Flow control is a separate per-connection brake. This post explains the difference, how to tell which one you are in, why rebalances and reconnect storms push memory over the line, and what to set on Kubernetes.

RabbitMQ blocks publishing on every node in the cluster when one node passes its memory high watermark, which defaults to 60% of the RAM the node detects. Flow control is a different, per-connection brake that slows fast publishers before memory gets there. They are easy to confuse in an incident, and the fix for one does nothing for the other. This post follows the RabbitMQ 4.4 memory alarm, resource alarm and flow control documentation, read on 5 December 2026.

What is the RabbitMQ memory high watermark?

It is a limit hint. When a node's memory footprint goes above it, the node raises a memory alarm and RabbitMQ blocks every connection that publishes messages. The default is vm_memory_high_watermark.relative = 0.6, meaning 60% of the RAM the node detected at startup.

The documentation is explicit that the limit does not stop a node from using more memory than the computed value. It is the point at which publishers are throttled. If memory keeps climbing past it, the operating system's out-of-memory killer ends the node, which on Kubernetes shows up as a pod restart with reason OOMKilled.

Is the memory alarm the same as flow control?

No. They have different triggers, different reach and different fixes.

Memory alarmDisk alarmFlow control
TriggerNode memory above the watermarkFree disk space below the limit (50 MB by default)A publisher outpaces queues, replication or disk
ReachCluster-wide: every node blocks publishersCluster-wideOne connection or channel path
What you seeConnections in state blocking or blocked; clients get connection.blockedSame statesConnection state flow, switching several times a second
Clears whenMemory falls under the watermarkFree disk rises above the limitThe slow component catches up
ConfigurationThreshold onlyThreshold onlyNone needed

Consumers are not blocked by either alarm. The intent is to stop producers and let consumers drain, although a connection that both publishes and consumes will feel the block, so use separate connections for each.

How do I tell which one is hitting my cluster?

Run these on any node, as the same user that runs RabbitMQ:

rabbitmq-diagnostics check_local_alarms
rabbitmqctl list_connections name state
rabbitmq-diagnostics memory_breakdown

If connections show blocked and check_local_alarms names a memory or disk alarm, an alarm is on, and memory_breakdown shows what holds the memory. If connections show flow and no alarm is listed, you are in flow control, so look at consumer count, prefetch and whether consumers acknowledge. The flow control guide points at exactly those as the usual limiting factors.

Why does a rebalance or federation reconnect storm push memory over the limit?

Because they create replication and connection work all at once, and that work lives in memory. A returning quorum queue member has to catch up from the leader's log, and the documentation treats it as temporarily unavailable while it does. A federation link or client fleet that reconnects with no delay opens a burst of connections, each with channel and buffer state.

A common pattern is a trigger, such as a node restart or a link flapping, followed by a second wave caused by the response: a second manual rebalance that moves the load to another node, or clients that retry every rejected publish immediately. Memory sits just under the watermark, the first alarm blocks publishers, and the retries pile onto the nodes that are still up. Check rabbitmq-diagnostics check_if_node_is_quorum_critical before you stop or move a node, and make one change at a time.

What should the memory watermark be on Kubernetes?

Set an absolute value. The documentation recommends it for containers because RabbitMQ will not always detect the effective cgroup limit, which a relative threshold depends on. The RabbitMQ Cluster Operator sets the high-water mark to 0.6 times the pod memory limit, so read what it set before you override it.

# rabbitmq.conf
vm_memory_high_watermark.absolute = 4Gi

# on a running node (lost on restart)
rabbitmqctl set_vm_memory_high_watermark absolute "4G"

Our rule of thumb, not a RabbitMQ default: keep the pod memory limit clearly above the watermark. The watermark is where publishers are throttled, and a pod limit equal to it lets Kubernetes kill the pod before the throttle has helped.

How do I stop memory alarms coming back?

  • Alert before the watermark. Scrape every node directly (the Prometheus plugin listens on 15692) and alert on memory use against the watermark and on any blocked connection. See the monitoring and alerting guide.
  • Keep consumers acknowledging and cap unacknowledged messages with a sensible prefetch. See RabbitMQ prefetch count.
  • Handle connection.blocked in clients, use publisher confirms, and retry with a capped backoff. While an alarm is on, publish operations eventually time out or fail.
  • Run rolling restarts one node at a time, and check quorum criticality first.
  • Do not raise the watermark to make an alarm stop, and do not set it to 0 unless you want publishing off: that setting blocks all publishers on purpose.

If an alarm is already on and you want an engineer on the cluster, emergency RabbitMQ support and the outage runbook are the next steps. AceMQ replies within 1 hour, and a senior engineer takes the case.

Sources

Frequently Asked Questions

What is the RabbitMQ memory high watermark?

It is the memory level at which a node raises a memory alarm and RabbitMQ blocks publishing connections. By default it is 60% of the RAM the node detects (vm_memory_high_watermark.relative = 0.6). It is a throttle point, not a hard cap, so the node can still use more memory than the limit.

What is the difference between a RabbitMQ memory alarm and flow control?

A memory alarm is cluster-wide: when one node passes its watermark, every node blocks publishing connections until memory falls back. Flow control is per connection, needs no configuration and slows a fast publisher so queues, replication and disk can keep up. Connections show the state blocked or blocking during an alarm and flow during flow control.

Why is RabbitMQ blocking my publishers when only one node is over the limit?

Memory and disk alarms are cluster-wide by design. If one node goes over its limit, all nodes block connections that publish. Consumers keep receiving, because connections that only consume are not blocked.

What should vm_memory_high_watermark be on Kubernetes?

Use an absolute value, for example vm_memory_high_watermark.absolute = 4Gi, rather than a relative one. RabbitMQ does not always detect the container's cgroup limit, so a relative value can be computed from the wrong total. The Cluster Operator configures the memory limit itself, so check what it set before you override it.

Does raising the memory watermark fix a memory alarm?

No. It moves the point at which publishers are throttled closer to the point at which the operating system kills the node. The fix is to drain memory: restore or add consumers, make sure they acknowledge, close leaked connections and find the largest consumer with rabbitmq-diagnostics memory_breakdown.

Scott Sternloff

Author

Scott SternloffSenior Enterprise Architect

Senior Enterprise Architect at AceMQ. Writes the technical coverage here: RabbitMQ, Kafka and Redis architecture, clustering and migrations.

Guides, comparisons and research

Go deeper on RabbitMQ

Guides

31
Show 25 moreShow fewer

Free Consultation

Get Expert Eyes on Your RabbitMQ Cluster

Whether you're troubleshooting a production incident, planning a migration, or want a second opinion on your architecture — our team is ready. No pitch, just answers.

Email Us