Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the vm_memory_high_watermark to > 1 defaults to total available memory #1285

Closed
gerhard opened this issue Jul 7, 2017 · 0 comments
Closed
Assignees
Milestone

Comments

@gerhard
Copy link
Contributor

gerhard commented Jul 7, 2017

free -b
1038778368

Expected:

rabbitmqctl set_vm_memory_high_watermark 0.999999

rabbitmqctl eval 'vm_memory_monitor:get_vm_memory_high_watermark().'
0.99999999

rabbitmqctl eval 'vm_memory_monitor:get_memory_limit().'
1038778357

erl -noshell -eval 'io:format("~p~n", [1038778368 * 0.99999999]).' -eval 'init:stop()'
1038778357.6122162

Unexpected:

rabbitmqctl set_vm_memory_high_watermark 1.0
Setting memory threshold on 'rabbit@rmq0-rmq-swapping' to 1.0

rabbitmqctl eval 'vm_memory_monitor:get_vm_memory_high_watermark().'
1.0

# I expect the memory limit to be set to 1038778368, but instead:
rabbitmqctl eval 'vm_memory_monitor:get_memory_limit().'
415511347

erl -noshell -eval 'io:format("~p~n", [1038778368 * 0.4]).' -eval 'init:stop()'
415511347.20000005

When setting an absolute memory that is higher than the available memory:

set_vm_memory_high_watermark absolute 2000MB
Setting memory threshold on 'rabbit@rmq0-rmq-swapping' to 2000000000 bytes

rabbitmqctl eval 'vm_memory_monitor:get_vm_memory_high_watermark().'
{absolute,2000000000}

rabbitmqctl eval 'vm_memory_monitor:get_memory_limit().'
1038778368
@gerhard gerhard added this to the 3.6.11 milestone Jul 7, 2017
@gerhard gerhard added the bug label Jul 7, 2017
@gerhard gerhard changed the title Setting the vm_memory_high_watermark to >0.(9) defaults to 0.4 Setting the vm_memory_high_watermark to >0.(9) should default to total available memory Jul 7, 2017
@gerhard gerhard added effort-low and removed bug labels Jul 7, 2017
@gerhard gerhard changed the title Setting the vm_memory_high_watermark to >0.(9) should default to total available memory Setting the vm_memory_high_watermark to >0.(9) defaults to total available memory Jul 7, 2017
gerhard added a commit to rabbitmq/rabbitmq-common that referenced this issue Jul 10, 2017
Prior to this change, setting the vm_memory_high_watermark to a value
higher than 1 (inclusive), would default to 0.4. This is different from
the behaviour when setting an absolute value, namely defaulting to the
total memory available.

Extracted common memory-related macros & records so that they can be
shared by tests.

re rabbitmq/rabbitmq-server#1285

[finishes #148470947]
@gerhard gerhard changed the title Setting the vm_memory_high_watermark to >0.(9) defaults to total available memory Setting the vm_memory_high_watermark to > 1 defaults to total available memory Jul 10, 2017
gerhard added a commit that referenced this issue Jul 10, 2017
This is meant to add a missing integration test that wraps up #1285

It's not a unit test and it can't run in paralle, but
set_disk_free_limit does the same wrong thing. We should either remove
them both or leave them as they are.

[#148470947]
gerhard added a commit to rabbitmq/rabbitmq-common that referenced this issue Jul 10, 2017
@rabbitmq rabbitmq deleted a comment from MrAmbiG Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants