rabbitmq icon indicating copy to clipboard operation
rabbitmq copied to clipboard

Outdated information about memory limits

Open mkuratczyk opened this issue 1 year ago • 11 comments

The Memory Limits section of https://hub.docker.com/_/rabbitmq is incorrect (perhaps was true a long time ago). Container limits are taken into account, so vm_memory_high_watermark.relative will be calculated based on container memory, not host memory. I think the whole section can be simply removed.

mkuratczyk avatar Mar 14 '23 13:03 mkuratczyk

Ah, good catch! I won't be able to get to it right away myself, but that's maintained at https://github.com/docker-library/docs/blob/master/rabbitmq/content.md if you (or someone else reading this) wanted to take a stab at a PR. :+1:

tianon avatar Mar 15 '23 21:03 tianon

Turns out this can still happen. A user created an issue today (using up to date version of RabbitMQ and Erlang) and I noticed:

Memory high watermark setting: 0.4 of available memory, computed to: 108.0799 gb

I'm fairly sure this is the host's memory, not container memory limit. I wonder what could be causing this in some situations.

mkuratczyk avatar Apr 03 '23 07:04 mkuratczyk

Erlang's imperfect detection of the limits using cgroups? cgroup version differences (IIRC some distribution have started rolling out v2 recently)?

michaelklishin avatar Apr 03 '23 07:04 michaelklishin

In rabbitmq cluster operator, we set total_memory_available_override_value to 80% of the resource limit in the Pod i.e. limit by cgroup. We could document this setting in the Memory Limits section, if Erlang doesn't play well with cgroups.

Zerpet avatar Apr 05 '23 11:04 Zerpet

I'm fairly sure this is the host's memory, not container memory limit. I wonder what could be causing this in some situations.

Is there any solution for this? 🙏 vm_memory_high_watermark.relative is not working when using rabbitmq 3 with Kubernetes memory limits and I think that it used to work in the past (Reference -> https://www.rabbitmq.com/kubernetes/operator/using-operator#resource-reqs)

luarx avatar Apr 11 '24 20:04 luarx

@luarx no, it never did work reliably because the runtime's ability to detect the amount of available memory is only limited to some OSes and likely cgroups v1 for now.

The docs have been updated to provide Kubernetes-specific recommendations.

michaelklishin avatar Apr 15 '24 20:04 michaelklishin

@tianon @yosifkit folks, can we integrate these recommendations from the RabbitMQ docs into this image, and then hopefully consider this issue resolved?

I would be happy to contribute if you tell me where to look in the source, and how to test a preview of my edits locally. Thank you!

michaelklishin avatar Apr 15 '24 20:04 michaelklishin

That's in https://github.com/docker-library/docs/blob/master/rabbitmq/content.md :eyes: (as linked above :sweat_smile:)

If you want to test the Docker Hub rendering, you can just create a repository and there's a preview in the private "edit" page, but I think markdown is probably limited enough that you can probably guess how it'll render pretty well (Hub's rendering is pretty vanilla). :innocent:

tianon avatar Apr 15 '24 21:04 tianon