Skip to content

Commit bb85739

Browse files
committed
Apparently the original upstream docs PR was wrong about vm_memory_high_watermark's absolute units -- they're bytes unless specified as a string with a suffix
1 parent 05530e4 commit bb85739

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ if [ "$1" = 'rabbitmq-server' ] && [ "$shouldWriteConfig" ]; then
221221
"{ loopback_users, $(rabbit_array) }"
222222
)
223223

224-
# https://github.com/rabbitmq/rabbitmq-website/pull/96/files
224+
# https://www.rabbitmq.com/memory.html#memsup-usage
225225
# "If the absolute limit is larger than the installed RAM or available virtual address space, the threshold is set to whichever limit is smaller."
226226
# specifically, if a memory limit isn't supplied to the container and "memory.limit_in_bytes" is thus an enormous constant, RabbitMQ will ignore it and use maximum available memory or address space instead
227227
if [ -r /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then
228228
memLimit="$(< /sys/fs/cgroup/memory/memory.limit_in_bytes)"
229-
rabbitConfig+=( "{ vm_memory_high_watermark, { absolute, $(( memLimit / 1024 / 1024 )) } }" )
229+
rabbitConfig+=( "{ vm_memory_high_watermark, { absolute, $memLimit } }" )
230230
fi
231231

232232
if [ "$haveSslConfig" ]; then

0 commit comments

Comments
 (0)