Redis Error Guide: 'ERR Background save already in progress' — Fix Overlapping BGSAVE Calls
Fix ERR Background save already in progress in Redis: diagnose concurrent BGSAVE, slow RDB forks, and backup jobs racing scheduled saves.
- #redis
- #troubleshooting
- #errors
- #persistence
Stuck on this Redis error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Overview
Redis returns Background save already in progress when you call BGSAVE (or SAVE, or trigger a save via BGREWRITEAOF/DEBUG RELOAD) while an RDB snapshot child process is already running. Redis forks a single child to write the RDB file; it will not fork a second one on top of it.
The literal error clients receive:
(error) ERR Background save already in progress
This is a safety guard, not a fault — Redis is protecting itself from two overlapping saves. It surfaces when a backup script fires BGSAVE while a scheduled save rule already triggered one, or when the previous save is slow because the dataset is large or disk I/O is saturated.
Symptoms
BGSAVEreturns the error whileINFO persistenceshows a save in flight.- Correlates with a large dataset, slow disk, or overlapping cron/backup jobs.
- Occasional latency blips as the fork copies-on-write during the save.
redis-cli BGSAVE
(error) ERR Background save already in progress
Common Root Causes
1. A save is genuinely still running
The previous BGSAVE (manual or from a save config rule) has not finished.
redis-cli INFO persistence | grep -E 'rdb_bgsave_in_progress|rdb_last_bgsave_status'
rdb_bgsave_in_progress:1
rdb_last_bgsave_status:ok
2. Backup job races the scheduled save
A cron/backup tool calls BGSAVE at the same time a save 900 1 rule fires.
redis-cli CONFIG GET save
1) "save"
2) "900 1 300 10 60 10000"
3. The save is slow (large dataset / slow disk)
A big dataset or I/O-starved disk makes each fork take long enough for the next request to collide.
redis-cli INFO persistence | grep rdb_last_bgsave_time_sec
4. AOF rewrite is also forking
An in-progress BGREWRITEAOF fork can coincide; Redis serializes these child processes.
How to diagnose
Step 1: Confirm a save is actually in progress
redis-cli INFO persistence | grep -E 'rdb_bgsave_in_progress|aof_rewrite_in_progress'
rdb_bgsave_in_progress:1 means wait — the guard is correct.
Step 2: Check how long saves take
redis-cli INFO persistence | grep -E 'rdb_last_bgsave_time_sec|rdb_last_save_time'
A large rdb_last_bgsave_time_sec explains frequent collisions.
Step 3: Find overlapping triggers
redis-cli CONFIG GET save
sudo journalctl -u redis-server --no-pager | grep -iE 'Background saving|DB saved|Saving' | tail
Compare the log timestamps to your backup schedule.
Step 4: Watch memory/fork cost
redis-cli INFO stats | grep -E 'latest_fork_usec'
A high latest_fork_usec means the fork itself is expensive on this host.
Fixes
Wait for the current save, then retry
The simplest fix — poll rdb_bgsave_in_progress and issue BGSAVE only when it is 0.
while [ "$(redis-cli INFO persistence | tr -d '\r' | awk -F: '/rdb_bgsave_in_progress/{print $2}')" = "1" ]; do
sleep 1
done
redis-cli BGSAVE
Stop racing the scheduler
Point backups at the RDB file Redis already writes on its save schedule instead of forcing a fresh BGSAVE, or align the cron time so it never overlaps.
Speed up saves
Put the RDB directory on faster disk, ensure enough free RAM for copy-on-write, and consider rdb-save-incremental-fsync yes to smooth I/O.
Use the last-save timestamp to avoid redundant saves
redis-cli LASTSAVE # only BGSAVE if this is older than your interval
What to watch out for
BGSAVEforks a child; on a large instance the fork copy-on-write can double memory transiently. Ensure headroom or saves themselves can fail.rdb_last_bgsave_status:err(not just “in progress”) points to a failed save — check disk space and permissions, that is a different problem.- Manual
SAVEblocks the whole server; preferBGSAVEand never callSAVEon a busy production instance. - Overlapping
BGSAVEandBGREWRITEAOFboth need a fork; Redis queues them, so tune their schedules apart.
Related
- Redis Error: ‘Background append only file rewriting already in progress’
- Redis Error: ‘Can’t save in background: fork: Cannot allocate memory’
- Redis Error: ‘MISCONF Redis is configured to save RDB snapshots’
Paste the failing command into the free incident assistant, and browse more Redis guides.
Fixed it? Get 500 Redis & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.