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

Don't warn about vm.overcommit_memory if persistence is disabled. #301

Closed
stephenmartindale opened this issue Dec 12, 2021 · 2 comments
Closed
Labels
Request Request for image modification or feature

Comments

@stephenmartindale
Copy link

I am using custom command-line arguments for redis-server to disable snapshotting, saving and persistence. Concretely, I have a Dockerfile that derives from :alpine that specifies a custom command:

FROM redis:6.2.6-alpine

# Disable `redis` Snapshotting, by default
CMD ["redis-server", "--save", "", "--appendonly", "no"]

This Dockerfile works as expected and I no longer see any routine snapshot saving or dumping to /data when the container halts. However, this warning about vm.overcommit_memory continues to be written to the container's logs:

WARNING overcommit_memory is set to 0! Background save may fail under low memory condition.
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the
command 'sysctl vm.overcommit_memory=1' for this to take effect.

Because the warning says, "background save may fail," I assume that this warning is erroneous because background saving is not enabled. This warning should therefore not be written to the logs in this case.

I know there are exactly N+1 issues about this warning, already, including #55, and, very recetly, #298 . I have read them and, so far, have yet to see one that covers this particular case, where persistence and background saving is actually not enabled and the warning continues to be displayed. False-positive warnings in logs are bad, as a rule, because they breed complacency from admins.

Of course, if there is some reason why vm.overcommit_memory should be enabled despite the fact that background saving is not, then the warning's wording should be altered to reflect that case. (Note: I am using Redis for caching, only, and need no persistence. In fact, persistence is actively undesirable in my scenario.)

@wglambert wglambert added the Request Request for image modification or feature label Dec 13, 2021
@tianon
Copy link
Contributor

tianon commented Dec 13, 2021

Unfortunately, this warning is printed by Redis itself, so I would suggest that this is an enhancement suggestion that should be filed at https://github.com/redis/redis (there's not anything we could do to remove that warning at the Docker image level). 😅

@stephenmartindale
Copy link
Author

@tianon : Thanks. I did not even notice that I was on the wrong repo. I guess I just posted this issue in the repo. that the other, oft-cited, related issues were filed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

3 participants