Docker Memory Limits 3.8 vs 3.9

100 views
Skip to first unread message

Tom Brouwer

unread,
Aug 16, 2021, 10:15:27 AM8/16/21
to rabbitmq-users

Hi All,

I have a question about the autodetection of Docker memory limits, which seems to work with RabbitMQ 3.8, but not with 3.9.

Previously, the docker images of RabbitMQ 3.8 were able to detect the Docker memory limits. For example, doing:

>> docker pull rabbitmq:3.8-management
>> docker create --name "rabbitmq_local" -p 5672:5672 -p 15672:15672 --memory "1g" rabbitmq:3.8-management
>> docker start rabbitmq_local

Would start RabbitMQ, and in the management interface, the high memory watermark would be nicely set to 410MB.

However, doing the above commands, but replacing 3.8 with 3.9, would set the high memory watermark to 12GB, which is 0.4 of my total machine memory. It seems like version 3.9 doesn't detect the correct (cgroup) memory limits (anymore ?). Since I cannot find anything about this in the release notes, I'm wondering if this is a bug.

My current workaround is to build the docker image with a custom configuration file, and setting  'total_memory_available_override_value'.

However, I quite dislike having the memory limits already hardcoded in my images, rather than the memory limits being set when the container is created. Is there any way to enable the detection of the correct memory limits for RabbitMQ 3.9?

Thanks in advance!

Best regards,

Tom Brouwer

Tom Brouwer

unread,
Aug 16, 2021, 3:01:43 PM8/16/21
to rabbitmq-users
After searching further, it turns out the 'cgroup memory limit support' is provided by the Docker image startup script, rather than RabbitMQ itself.

The functionality that prepares the configuration file to contain the correct limit, is included in the docker docker entrypoint for version 3.8, and can be found here: https://github.com/docker-library/rabbitmq/blob/cd44d4e7a4335ae137c1723772e2a777f0466d67/3.8/ubuntu/docker-entrypoint.sh#L303 . It's deprecated in 3.9.

I ended up using an edited version of that code in my Docker image to set the correct memory.

Best regards,

Tom Brouwer

Op maandag 16 augustus 2021 om 16:15:27 UTC+2 schreef Tom Brouwer:
Reply all
Reply to author
Forward
0 new messages