ERR Can't save in background: fork failed: Background save failed: fork failed
Redis의미
Redis가 백그라운드 RDB 스냅샷이나 AOF rewrite를 위한 자식 프로세스 생성(fork)에 실패했다. 영속성 작업을 실행할 수 없어 데이터를 디스크에 쓸 수 없다.
원인
운영체제가 fork에 충분한 메모리를 할당할 수 없다. 보통 overcommit_memory가 비활성화되어 있어 Redis가 사용 중인 메모리의 사본만큼을 예약하려 할 때 시스템이 거부한다. 물리/가상 메모리 부족이나 프로세스 수 한도도 원인이 될 수 있다.
해결 방법
Linux에서 메모리 overcommit을 활성화한다: sysctl vm.overcommit_memory=1 (영구 적용하려면 /etc/sysctl.conf에 추가). 서버 메모리를 늘리거나 Redis 메모리 사용량을 낮춘다(maxmemory). 충분한 swap 공간을 확보한다. 프로세스/파일 디스크립터 한도(ulimit)를 확인한다. 영속성이 중요하다면 이 설정 없이 운영 환경에 배포하지 않는다.
같은 데이터베이스의 다른 항목
- ERR unknown subcommandERR unknown subcommand or wrong number of arguments (알 수 없는 하위 명령 또는 잘못된 인수 개수)
- ERR Client sent AUTH, but no password is setERR AUTH <password> called without any password configured for the default user (Redis 6+) / ERR Client sent AUTH, but no password is set (Redis <6) (비밀번호가 설정되지 않은 상태에서 AUTH 호출)
- ERR DEBUG command not allowedDEBUG command not allowed
- NOPROTO unsupported protocol versionUnsupported RESP protocol version
- ERR Unknown option or number of arguments for CONFIG SETUnknown option or number of arguments for CONFIG SET (older versions: Unsupported CONFIG parameter) (CONFIG SET의 알 수 없는 옵션 또는 인수 개수 오류)
- ERR MULTI calls can not be nestedMULTI calls can not be nested
- ERR Lua script attempted to access nonexistent global variableLua script attempted to access a nonexistent global variable (Lua 스크립트가 존재하지 않는 전역 변수에 접근)