At a glance
Last AOF Rewrite Status reports whether the most recent Append-Only File rewrite finished cleanly. It readsaof_last_bgrewrite_statusfromINFO persistence, which is eitherokorerr. The AOF is Redis’s write-ahead log; it is periodically rewritten (compacted) so it does not grow without bound. If a rewrite fails, the AOF stops shrinking and can keep growing on disk, and your durability guarantee quietly weakens. This is a binary health flag, not a trend:okis fine,errmeans the last compaction failed and someone needs to find out why before the next restart depends on a broken file.
Calculation
There is no arithmetic; the card surfaces a singleINFO persistence field verbatim and maps it to a colour:
INFO persistence:
aof_current_size against aof_base_size: the ratio is what triggers an automatic rewrite (auto-aof-rewrite-percentage, default 100, meaning rewrite when the file has doubled). If status is err and aof_current_size keeps climbing while never resetting toward aof_base_size, that confirms the rewrites are failing and the file is not being compacted.
Worked example
An SRE team runs Redis 7.2 as a durable job queue with AOF enabled (appendonly yes, appendfsync everysec). The node has 8 GB RAM and a 20 GB data volume. Snapshot on 18 Apr 26.
Healthy baseline at 08:00:
BGREWRITEAOF manually and confirm the status returns to ok and aof_current_size resets toward aof_base_size; (3) check aof_last_write_status to confirm no recent writes were lost; (4) add a disk-free alert on the AOF volume so the next near-miss is caught before the rewrite fails. Three things this shows:
- A failed rewrite is rarely about Redis; it is usually disk or fork headroom. The two dominant causes are a full volume and a failed
fork()under memory pressure (no overcommit headroom). Check those first, not Redis config. - An
errstatus is also a self-worsening problem. A failed rewrite means the file keeps growing, which makes the next rewrite need even more disk and even more likely to fail. It does not self-heal; you must intervene. - Rewrite status and write status are different durability signals.
aof_last_bgrewrite_status:errmeans compaction failed (operational nuisance, slow restart).aof_last_write_status:errmeans recent writes did not reach disk (data loss risk). They share a root cause here (full disk) but mean different things; always check both.
Sibling cards
Reconciling against the source
Where to look in Redis:For ElastiCache or MemoryDB, AOF is managed by the service andINFO persistencefor the field itself plus its context:redis-cli INFO persistence | grep -E 'aof_'. Readaof_last_bgrewrite_status,aof_last_write_status,aof_current_size,aof_base_size, andaof_rewrite_in_progresstogether.BGREWRITEAOFto trigger a manual rewrite; watch the Redis log (logfileor stdout) for the child-process success or failure line. The Redis server log itself, which records the precise reason for a failed rewrite (for example “Can’t rewrite append only file in background: fork: Cannot allocate memory” or a disk-write error).CONFIG GET appendonlyto confirm AOF is actually enabled; ifno, this card is not applicable.CONFIG GET dirand a disk check (df -h) on that directory to confirm there is room for a rewrite.
INFO persistence may be restricted; the managed equivalent is the engine’s automatic backup events surfaced through CloudWatch and the backup history, which is also the basis for the Last Successful Backup (hours ago) card.
Why our number may legitimately differ from a manual reading:
Known limitations / FAQs
The card sayserr but Redis is serving traffic fine. Is this urgent?
A failed AOF rewrite does not stop Redis serving reads and writes, so the storefront feels fine. The urgency is about durability and disk: the AOF is no longer being compacted, so it keeps growing, and a restart now would replay a larger, possibly truncated file. Treat it as same-day, not same-minute: free disk or fix the fork headroom, then run BGREWRITEAOF and confirm it returns to ok.
What is the difference between AOF rewrite status and AOF write status?
aof_last_bgrewrite_status (this card) is about compaction: did the background rewrite that shrinks the file succeed? aof_last_write_status is about durability: did the most recent append to the AOF actually reach disk? Rewrite err is an operational nuisance (file grows, slow restart). Write err is a data-loss risk (recent writes may not be persisted). Check both; they often fail together when the disk is full but mean different things.
My AOF is disabled. What does this card show?
If appendonly is no, AOF persistence is off and this card is not applicable; it renders as grey/n/a. The field may still hold a stale ok/err from the last time AOF was enabled, which is why the card keys off aof_enabled rather than the status field alone. If you rely on RDB snapshots instead, watch Last RDB Save (minutes ago).
Why did the rewrite fail with plenty of disk free?
The other common cause is a failed fork(). A background rewrite forks a child process, and on a write-heavy instance the child can need significant copy-on-write memory. If the OS has no overcommit headroom (vm.overcommit_memory not set to 1) or the instance is near its memory ceiling, the fork is refused and the rewrite fails. The Redis log will say so explicitly. Check Memory Used vs Maxmemory % and the host’s overcommit setting.
How do I clear an err status?
Fix the underlying cause (disk space or fork headroom), then run BGREWRITEAOF manually. On success, aof_last_bgrewrite_status flips to ok, aof_current_size resets toward aof_base_size, and the card goes green on the next poll. The status does not clear by itself; it only updates when a rewrite actually runs and completes.
Should I worry about a single err that recovered on its own?
A status that flipped to err and then back to ok on the next automatic rewrite usually means a transient resource pinch (a brief disk-full or memory spike) that cleared before the retry. It is worth a glance at the log to confirm the cause was transient, but a single self-recovered err is not the same as a persistent one. A status stuck on err across multiple rewrite attempts is the real problem.
Does AOF rewrite failure affect a replica’s durability?
A rewrite failure is local to the node it happened on. If a primary’s AOF rewrite fails but it has a healthy in-sync replica (see Connected Replicas), your data still has a live second copy in that replica’s memory and on its own AOF. Replication is a separate durability layer from local persistence; do not treat a single node’s AOF err as total data loss risk if replicas are healthy, but do fix it, because replicas can fail too.