Append only

redis.conf

dir /data
save ""

appendonly yes
appenddirname "appendonlydir"
appendfilename "appendonly.aof"
appendfsync everysec

aof-use-rdb-preamble yes
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
appendfsyncBehavior
everysec
  • Background fsync
  • A crash can lose about one second of writes
always
  • Fsync each write batch before reply
  • Strongest AOF durability with fsync latency
no
  • Operating-system flushing
  • Larger potential loss window

Files in Redis 7+

/data/appendonlydir/
├── appendonly.aof.1.base.rdb
├── appendonly.aof.1.incr.aof
└── appendonly.aof.manifest

Automatic rewrite

  • AOF grows with every write; rewrite removes obsolete operations.
  • With this config, rewrite starts above 64 MB after 100% growth since the previous rewrite.
  • Rewrite uses CPU, memory, and disk I/O while retaining the old generation until the atomic switch.

Runtime status

INFO persistence
SignalEffect
aof_last_write_status is errRedis rejects writes that require a healthy AOF
aof_last_bgrewrite_status is errObsolete operations remain and AOF continues growing
aof_rewrite_scheduled is 1Rewrite waits for another background persistence operation
aof_delayed_fsync growsScheduled AOF fsync work exceeds storage throughput
current_cow_size grows during rewriteCopy-on-write increases process memory while the child exists