The error "dokku redis can't save in background fork cannot allocate memory" occurs when Redis fails to create a child process (fork) to handle the saving of data in the background. This failure is due to insufficient system memory available for the fork operation. Redis requires enough memory to create a copy of its entire dataset during the fork, as it uses a Copy-On-Write (COW) mechanism to save data efficiently without affecting the main process.
To resolve this issue, you have several options:
vm.overcommit_memory kernel parameter to allow Redis to allocate more memory for the fork operation. Set it to 1 to allow more aggressive allocation, but be cautious as this might lead to out-of-memory problems.
save directives). Be aware that doing so may increase the risk of data loss in case of a crash.
Note that depending on your specific use case and needs, you may need to combine multiple approaches to resolve the issue effectively.