DBAtlas · Database operations atlas

ERR Can't save in background: fork failed: Background save failed: fork failed

Redis

What does it mean?

Redis failed to create a child process (fork) for a background RDB snapshot or AOF rewrite. Because persistence cannot run, data cannot be written to disk.

Why does it happen?

The operating system cannot allocate enough memory for the fork; usually overcommit_memory is disabled and the system refuses when Redis tries to reserve roughly a copy of the memory it uses. Insufficient physical/virtual memory or process count limits can also cause it.

How to fix it

Enable memory overcommit on Linux: sysctl vm.overcommit_memory=1 (add it to /etc/sysctl.conf to make it permanent). Add memory to the server or lower Redis memory usage (maxmemory). Provide sufficient swap space. Check process/file descriptor limits (ulimit). If persistence is critical, do not go to production without these settings.

Open in DBAtlas →

More from this engine