I believe this question is somewhat answred here: MISCONF Redis is configured to save RDB snapshots.
I am currently running a Redis docker container, which from time to time returns the following error:
MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
In combination with:
redis_1 | 4410:C 06 Feb 2020 23:50:57.045 # Failed opening the RDB file crontab (in server root dir /etc) for saving: Permission denied
Is this because redis is running out of room? Is there something I can do to clean-up redis? I am only using redis as the messaging broker layer, so the data is not really needed to be persisted ...
I also see the following WARNINGS
coming up from the redis container:
# WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
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.
WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
I feel like maybe this question is the perfect opportunity to ask redis/devops experts to maybe outline the best way to configure redis with docker-compose, I currently have:
redis:
build:
context: ./redis
dockerfile: Dockerfile
ports:
- '6379:6379'
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf
sysctls:
net.core.somaxcomm: '511'
restart: on-failure
If there is anything better that can be done that would be amazing and appreciated.