checkmk icon indicating copy to clipboard operation
checkmk copied to clipboard

Fix redis warning

Open dnlldl opened this issue 1 year ago • 2 comments

When Checkmk starts, there is the following warning in ~/var/log/redis-server.log:

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 -w vm.overcommit_memory=1' for this to take effect.

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

dnlldl avatar Jun 20 '24 01:06 dnlldl

Sorry, but this is wrong - like the message says - this line should go to /etc/sysctl.conf and not into redis.conf

moschlar avatar Jun 20 '24 07:06 moschlar

Sorry, but this is wrong - like the message says - this line should go to /etc/sysctl.conf and not into redis.conf

You are welcomed to do some testing and improve this PR. sysctl.conf isn't taken into account by Checkmk's Redis server, it only works for the base OS config, for example when installing and using redis-server on the base OS.

dnlldl avatar Jun 20 '24 12:06 dnlldl

@dnlldl I am afraid @moschlar is correct. Redis just lets you know, that the Linux kernel is preventing memory overcommiting and that this can be an issue for Redis in some situations. Only a system admin for the Linux system can change this setting, if they think, that is a sane thing to do. It really depends on the environment.

Also, even if the change you propose did work, we would not want to suppress this perfectly valid message, let alone change your Linux system settings from an application.

robin-checkmk avatar Aug 05 '24 08:08 robin-checkmk

@dnlldl I am afraid @moschlar is correct.

According to my tests, he is wrong, at least on SUSE 15. On which OS did you test? On SUSE 15 with the latest available Checkmk CRE, Checkmk's Redis configuration doesn't take into account /etc/sysctl.conf.

Redis just lets you know, that the Linux kernel is preventing memory overcommiting and that this can be an issue for Redis in some situations. Only a system admin for the Linux system can change this setting, if they think, that is a sane thing to do. It really depends on the environment.

That is totally fair. I haven't tested if updating Checkmk could eventually overwrite omd/packages/redis/skeleton/etc/redis/redis.conf (a very quick test tells me that it doe not, at least for a patch). If not then it's totally reasonable for a system administrator to set it once and forget.

Also, even if the change you propose did work, we would not want to suppress this perfectly valid message, let alone change your Linux system settings from an application.

Just for clarity sake, it's not a Linux system setting, it's a Redis setting, and in this case more specifically, Checkmk's Redis instance setting. The configuration in omd/packages/redis/skeleton/etc/redis/redis.conf doesn't affect any other Redis instance. With that being said, yes, this setting can have an impact on the system as a whole.

I'm closing this PR, at least it's documented here for anyone else wondering. Thanks for the comments!

dnlldl avatar Aug 05 '24 14:08 dnlldl