MISCONF Redis is configured to save RDB snapshots

Redis Save Fails: Fix BGSAVE and RDB Errors Fast

Database Errors Intermediate 👁 10 views 📅 Jun 19, 2026

Redis won't save because of disk issues or memory limits. Here's what actually fixes it, from a guy who's seen this kill production apps.

1. Disk Space Is Full — The #1 Reason Redis Fails to Save

Last month I had a client whose Redis server just stopped writing data. Their app was fine for reads, but every 5 minutes the logs showed MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. The fix? Their disk was 99% full. Redis tried to write the RDB file to /var/lib/redis, but there was no room.

Here's the test I run first:

df -h /var/lib/redis

If the usage is above 90%, that's your problem. Redis needs enough free space to write a temp file and rename it. The file size is roughly the same as your dataset in memory. So if you have 4GB of data, you need at least 4GB free.

Quick fix: Move the RDB directory to a partition with more space. Edit /etc/redis/redis.conf and change dir ./ to dir /data/redis (or wherever you have room). Then restart Redis:

sudo systemctl restart redis

Or if you're using a container, mount a volume with enough space. I've seen people use a separate SSD for this — works great.

On AWS, check your EBS volume. If it's a gp2 with burst credits exhausted, writes slow down and Redis times out. Swap to gp3 or increase size.

2. Fork Cannot Allocate Memory — The Hidden Killer

This one's trickier. Redis uses fork() to create a child process that writes the snapshot. If your server is low on RAM or has a strict overcommit_memory setting, the fork fails silently.

I've seen this on servers running 8GB RAM with 6GB Redis dataset. Forking requires roughly the same amount of memory again because of copy-on-write. If you're out of memory, the kernel says no.

Check if this is your issue: Look in /var/log/redis/redis-server.log for Can't save in background: fork: Cannot allocate memory.

Fix it: Change the kernel's memory overcommit setting. This tells the kernel to allow the fork even if memory is tight (it usually works because COW doesn't use all that memory right away):

echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
sysctl vm.overcommit_memory=1

Then restart Redis. I've saved three different clients with this one line. It's safe — the kernel will still kill a process if memory genuinely runs out, but that's rare.

Another option if you can't change sysctl: reduce your maxmemory setting in redis.conf. Set it to 70% of your total RAM. That leaves headroom for the fork.

Wait — I said automatic restart is bad. Use config rewrite instead.

If Redis is running but failing saves, you can fix it without restarting. Connect with redis-cli and run:

CONFIG SET dir /data/redis
CONFIG SET dbfilename dump.rdb
CONFIG REWRITE

That changes the config on the fly and saves it to disk for next time. I use this all the time in production.

3. Save Timeout or Slow Disk Writes

Redis has a stop-writes-on-bgsave-error option. When it's set to yes (default), a failed save makes the whole database read-only. That's why you get the MISCONF error. But sometimes the save is just slow — not failing.

I've seen this on shared hosting and cheap VPS where disk IO is terrible. Redis tries to write, but it takes more than the default 60 seconds. The client times out, and Redis gives up.

Logs to check: Look for Timeout writing to disk or Background save error.

Fix it: Increase the timeout. In redis.conf, find timeout 0 — that's the idle timeout, not the save timeout. The save timeout is actually controlled by rdb-save-incremental-fsync and the kernel's dirty page settings. But the simpler fix is to disable the stop-writes-on-bgsave-error if you're okay with losing the latest data on a crash:

CONFIG SET stop-writes-on-bgsave-error no
CONFIG REWRITE

This lets Redis keep handling writes even if the save is slow. The snapshot will eventually complete. I only recommend this if you're sure the disk is just slow, not dead.

For slow disks, also check if you're using appendonly yes (AOF). If so, the AOF rewrite can conflict with the RDB save. I've seen this on a 10GB dataset taking 20 minutes. The fix was to increase auto-aof-rewrite-percentage to make rewrites less frequent.

Quick Reference — Fix by Cause

Cause What to Check Fix It
Disk full df -h for Redis dir Free space or change dir in config
Fork memory failure Log says Cannot allocate memory Set vm.overcommit_memory = 1
Slow disk / timeout Log says Timeout writing to disk Set stop-writes-on-bgsave-error no
AOF conflict AOF rewrite running during save Increase auto-aof-rewrite-percentage

Most of the time, it's disk space or fork memory. I start with df -h and dmesg | tail. Fix those two things, and your Redis saves will work again. If not, check the logs — they tell you exactly what's wrong, just read them.

Was this solution helpful?