Back to results for “Monitoring”
Redis › Redis Replication

What is replication lag, and what factors can cause a replica to fall noticeably behind its primary server?

Intermediate

Answer

Replication lag is the delay between when a write happens on the primary and when that same change is actually reflected on a replica, which can be caused by network latency between the servers, the replica being overloaded with its own read traffic, a slow disk affecting the replica's ability to keep up, or a very high write volume on the primary that outpaces the replica's processing speed.
-- Check replication lag using the INFO command
redis-cli -h replica_host info replication | grep master_repl_offset
Real-world example A team notices their reporting dashboard showing slightly outdated data and discovers their replica had fallen several seconds behind due to unusually high read traffic, prompting them to add an additional replica to better distribute the load.

Common follow-ups: How do you measure the exact replication lag in seconds or in offset?;What is an acceptable amount of replication lag for a typical application?