Proposal: increase the default value of vm_memory_high_watermark
in RabbitMQ 4.0
#10518
-
We are considering increasing the default value of We would appreciate your input on this topic. Are you using the default Additional details that would be helpful (please share as much as you can):
We appreciate your input! |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 9 replies
-
Hi, we are using |
Beta Was this translation helpful? Give feedback.
-
During this discussion I ask everyone to be mindful of a few things:
|
Beta Was this translation helpful? Give feedback.
-
Judging from the initial part of this discussion, the important factor is how much memory the runtime can/does allocate upfront, and/or how much memory certain queue types can use. In part because the actual footprint is correlated with the allocation. Classic Queue FootprintA durable CQv2 queue with messages published as persistent can have a low footprint (although the post does not really focus on memory in general). However, CQv1 are still the default in 3.13. We expect this to change in 4.x as soon as Other than that, a durable classic queue with messages published as persistent does not really Quorum Queue FootprintQuorum queues do not optimize for the minimum possible footprint by default. They optimize for Changing these defaults will require a lot of testing. They work reasonably well for many deployments. Stream FootprintStreams have very low memory footprint without any special tuning except for the mentioned several times peculiarity on older K8S with cgroups v1 What Would Allow for a Higher DefaultTherefore in order to increase the default for similar workloads, there are a few key areas of potential improvement:
But with a potentially lower pre-allocation rate and CQv2, the default can go up somewhat, maybe to 0.6, 0.7 or or something like that. |
Beta Was this translation helpful? Give feedback.
-
To add a data point... We run dozens of RabbitMQ clusters of varying size and throughput (3-11 nodes each with throughputs ranging from tens/s to high hundreds of thousands/s), all running in EC2 without k8s. We have found that
I expect with CQv2 and other improvements we would be even more comfortable with our high default. |
Beta Was this translation helpful? Give feedback.
-
In our experience the system that would benefit the most from increasing the watermark are the ones with low amount of memory allocated. I see a lot of environments with 4GB or lower total memory. In such a system the risk of increasing the watermark also significantly increases the risk of OOM because queue pile up, or channel buffering, or any sort of overload will very quickly push the system to a state where a single process can trigger the OOM. The systems with adequate or large amount of memory allocated (16GB or higher) hardly benefit from an increase under normal operations or during an overload because of the recent optimisations (CQv2, QQ, etc). Using up to 0.6 for such systems can save system resources without much risk, and this setting is naturally found during the optimisation phase, so no default change is warranted, imho. Changing the default would increase the OOM issues for small systems with little benefit for bigger systems. It is debatable which is better: blocked publishers or OOM. In my experience blocked publishers are safer for RabbitMQ during an overload. I think that optimising the default WAL size for small deployments is more relevant. |
Beta Was this translation helpful? Give feedback.
-
We (CloudAMQP) set a default value of Over the years we've experimented with different default values, and there are pros and cons with all selections, but in the current era (version Many ways to get to OOM are not stopped by the watermark. A low watermark will lead to not using system resources efficiently. |
Beta Was this translation helpful? Give feedback.
-
We are currently using the default value of 0.4 . Currently, I think now in the container world, which probably most of the people are having with RabbitMQ, it does not make a lot of sense of having this value of 0.4 , because basically we are wasting 60 % of the memory being defined to be used by RabbitMQ in the container. As anyway, the container will only have RabbitMQ server inside of it.
Having this value be increased to lets say 0.8 , would make sense in a container world. |
Beta Was this translation helpful? Give feedback.
-
We've just merged a change to set the default in RabbitMQ 4.0 to 0.6. Unless something comes up during the beta/release candidate testing, that's what we are going with for now. |
Beta Was this translation helpful? Give feedback.
We've just merged a change to set the default in RabbitMQ 4.0 to 0.6. Unless something comes up during the beta/release candidate testing, that's what we are going with for now.
#12161