Determining an exact answer is difficult because RabbitMQ’s memory usage depends on many factors (message sizes, how many messages actually end up “hot” in RAM, the behavior of quorum queues, etc.). However, we can try to “ball‐park” an estimate given the numbers you supplied. (Keep in mind that this is a very rough–order‐of–magnitude calculation and that in production you would want to do some load–testing, and—if possible—monitor a similar system under load.)
Let’s review the numbers you gave:
- Connections: 1,200
- Channels: 8,000
- Exchanges: 2,500
- Quorum queues: 3,300 (each might hold up to 10,000 messages)
- Virtual hosts: 24
- Publish rate: ~2,000 msg/sec
There are several “classes” of memory usage in a RabbitMQ node:
-
Control structures and bookkeeping for each resource:
Every connection, channel, exchange, queue (including quorum‐queue metadata), and virtual host uses some amount of RAM. For example, a “plain” connection might use some hundred kilobytes (say 200–500 KB) for its state. Channels add tens of kilobytes each. Exchanges (and virtual hosts) add a little overhead. (These numbers will vary by version, configuration, and even the Erlang version used.)
-
Quorum queues:
Quorum queues have been known to have a heavier memory footprint than classic queues. Not only do they store metadata for queue “replication” but if you have messages in the queues, each message carries some per‐replica state. If you are “backed up” with many messages in RAM (or if they are “hot” from the producers), then memory usage can spike. (Typically, if you have persistent messages you will “page out” messages to disk, but they still consume management overhead and some RAM for the metadata.)
-
Message payloads / internal buffers:
Even if the messages are small, if many are in memory at one time then you have to account for the message payload sizes plus extra overhead.
Here’s a rough “back‐of–the–envelope” estimate:
1. Bookkeeping Overhead
-
Connections:
Let’s assume roughly 200–500 KB per connection. Using a middle‐of–the–road number of 300 KB:
1,200 × 300 KB ≈ 360 MB
-
Channels:
If we assume say 50 KB per channel:
8,000 × 50 KB ≈ 400 MB
-
Exchanges and Virtual Hosts:
Even if you budget a conservative 0.1–0.2 MB per exchange and similarly little per vhost, even 2,500 exchanges × 0.1 MB gives about 250 MB and virtual hosts add only a minor amount. So roughly +250–300 MB.
-
Quorum queue metadata:
This is “heavier” than for classic queues. A rough figure might be on the order of 1–2 MB per quorum queue even when “empty”. For 3,300 queues, let’s assume 2 MB each:
3,300 × 2 MB = 6,600 MB (i.e. ~6.6 GB)
So from just the control structures you might have around:
360 MB + 400 MB + 300 MB + 6,600 MB ≈ 7.66 GB
2. Message Payloads
The “up to 10,000 messages” per queue is a worst–case scenario. How many of those messages will be simultaneously in memory is workload–dependent and also depends on whether you have flow–control / paging enabled. For instance, if every quorum queue were full with 10,000 messages and the message size is, say, 1 KB (plus overhead), that’s:
3,300 queues × 10,000 messages × ~1 KB ≈ 33 GB
Even if messages are smaller, or not all queues are “full” at the same time, you might easily add another 20 GB or more. (Note that many deployments try to avoid having huge backlogs in RAM by paging messages to disk; however, this may have performance consequences.)
3. Buffers, Protocols, and Other Overheads
There is also some additional working memory used by the broker for various caches, internal networks (especially in a cluster), protocol buffers, and compression if used, etc. It is wise to add some headroom (say 20–30% extra above what the arithmetic gives you).
Putting It All Together
- Base overhead (control data): ~7–8 GB
- Message data: This could range from very little (if queues are mostly empty or messages are paged out) to tens of GB if many queues are holding thousands of messages. If you need to plan for worst–case “all in memory” behavior, you might add another 20–33+ GB.
- Headroom / buffers: Additional 20–30%
Thus, in a fairly busy system with the numbers you indicated, it is not unreasonable to plan on provisioning on the order of 30–50 GB of RAM for the entire cluster so that you neither starve RabbitMQ of memory nor run into performance issues when all these structures and message overheads add up. (If you expect many queues to routinely “fill up” with thousands of messages each and the messages are non–trivial in size, then you might even need more.)
Final Answer
For a RabbitMQ cluster (version ~4.1.1) serving around 1,200 connections, 8,000 channels, 2,500 exchanges, 3,300 quorum queues (each holding up to 10,000 messages), 24 virtual hosts and a publish rate of about 2,000 msg/sec, you would likely want to provision roughly 30–50 GB of RAM cluster–wide under heavy load conditions. (In many cases you might find that your live working set is lower if most queues are not filled to the maximum at once or if messages are efficiently paged to disk, but planning conservatively is wise.)
Note:
These numbers are very rough estimates. The actual memory usage will depend on:
- The actual size of each message
- How many messages are actually in memory versus paged out
- The internal overhead of the specific RabbitMQ version and Erlang VM
- Operational settings such as garbage collection, flow control, and queue policies
You should perform load–testing and monitoring on your expected workload to fine–tune your capacity planning.