Preallocated memory and other memory difference between Physical vs Virtual machine #9000
-
Hi, We're running rabbitmq 3.11.13 in a containerized k8s environment. While benchmarking memory usage, we noticed difference in preallocated memory reported on management UI between physical system and virtual machine. The usage is almost identical on these two systems. Yet we see difference between two factors:
Is there any difference in memory management in physical system vs virtual machine. We want to predict the memory usage and accordingly set the strategy, pod limits, high watermark settings etc, and these differences between VM and physical system are kind of confusing us. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is more of an Erlang question than a RabbitMQ question. Erlang provides a lot of memory tuning options (see https://www.rabbitmq.com/runtime.html#allocators, https://www.erlang.org/doc/man/erts_alloc.html) and some of these flags might be configured differently in the Docker container for example. Some decisions can also be made by the Erlang runtime based on the resources discovered on startup. Do not expect identical usage even if you do exactly the same things and if this a live environment with messages going in and out, even if at similar rates, these values will be different to some extent. In both cases your usage is very low, so I guess the key question is whether it ever goes significantly above these levels. |
Beta Was this translation helpful? Give feedback.
There is no simple answer this. Memory management is a very complex topic - there are operating-system level aspects, virtualization aspects, containerization aspects, (Erlang, in this case) runtime aspects and then there is actual application (RabbitMQ) usage, but since Erlang is a garbage-collected language, even here the usage is not always obvious, since it's not explicit. On top of this, all these layers have many configuration options and change from version to version.
If you are interested in the details, well, brace yourself for a long journey. I certainly don't claim to understand all aspects of the memory management involved in running RabbitMQ. :)
You can start here for example: