-
Notifications
You must be signed in to change notification settings - Fork 431
Add "vm_memory_high_watermark" to the generated config, sourced from the value of the "memory.limit_in_bytes" cgroup restriction #105
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
Conversation
(the other minor changes in this PR just make sure that this value is actually set appropriately even if no environment variable configuration is supplied) |
root@08883e8f3ead:/# cat /etc/rabbitmq/rabbitmq.config
[ { rabbit, [
{ loopback_users, [ ] },
{ vm_memory_high_watermark, { absolute, 104857600 } },
{ tcp_listeners, [ 5672 ] },
{ ssl_listeners, [ ] },
{ hipe_compile, false }
] } ]. |
Maybe we shouldn't set it at all if the |
https://www.rabbitmq.com/production-checklist.html#resource-limits-ram has some good info about recommendations for setting this value I'm wondering if we should only do something like 90% of the available cgroup limit, or just subtract some static overhead (perhaps based on the current usage at the time we calculate the value?) |
Since rabbitmq (and most programs with memory limits
|
Hello, any chance to have this PR merged (after rebasing)? Having properly configured high memory watermark when using memory limit is important feature to us. After backporting the feature to my own RabbitMQ docker image, I found that setting the value of |
bb85739
to
fd27ced
Compare
…the value of the "memory.limit_in_bytes" cgroup restriction
fd27ced
to
d2bd71d
Compare
Thanks for the prod, @jperville ❤️ I've updated this to implement something similar to what @yosifkit laid out above:
|
How long does it take for the official image on docker hub to be updated with the new entrypoint? Still not updated 15 hours after. |
We'll make a PR to update the library later today. 👍 From https://github.com/docker-library/rabbitmq/blob/master/README.md:
|
- `drupal`: 8.3.0 (docker-library/drupal#78), remove 8.2 (docker-library/drupal#80) - `ghost`: add `alpine` variant (docker-library/ghost#55) - `mongo`: more edge cases (docker-library/mongo#167, docker-library/mongo#169) - `postgres`: adjust append (docker-library/postgres#270) - `rabbitmq`: add `vm_memory_high_watermark` support based on cgroup limits (docker-library/rabbitmq#105) - `rocket.chat`: 0.55.0-rc.1 - `wordpress`: add `wp-cli` variant (docker-library/wordpress#198)
The official image is failing for me on memory allocation "Memory limit set to 0MB of 16049MB total." |
I have the same issue as @qiuyuzhou Setting |
Without specify RABBITMQ_VM_MEMORY_HIGH_WATERMARK, then it failed. |
I think we could add information about this var to README at least |
Docs PR is up at docker-library/docs#879. 👍 |
I do want to repeat my request from #147 (comment) though:
|
@tianon Just ran into this error. Here's my output:
|
Ahhh, thank you @jamesmallen -- that explains it. That $ echo $(( 18446744073709551615 / 1024 ))
0
$ echo $(( 18446744073709551615 * 40 / 100 ))
0 Going to update #149 now! ❤️ ❤️ |
Compared to $ awk 'BEGIN { v = 18446744073709551615; print v / 1024 }'
18014398509481984
$ awk 'BEGIN { v = 18446744073709551615; print v * 0.4 }'
7378697629483821056 |
Closes #48
Some example test cases:
I'm not sure if we should be going slightly lower than the available value.
I checked the standard default for this output when
vm_memory_high_watermark
isn't specified, and got the following:So it looks like the default behavior is actually a fraction of the total available.