What is a reasonable difference between master and slave offsets?

40 views
Skip to first unread message

Vishy Kasar

unread,
Sep 1, 2017, 9:54:52 PM9/1/17
to Redis DB
In use case 1, I have a master info replication like this:

# Replication
role:master
connected_slaves:1
slave0:ip=x.x.x.x,port=1000,state=online,offset=1027859789858,lag=1
master_repl_offset:1027859838002
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:1027858789427
repl_backlog_histlen:1048576

Master gets 40 requests per second. 

In use case 2, I have master info replication as this:

# Replication
role:master
connected_slaves:1
slave0:ip=y.y.y.y,port=1000,state=online,offset=269174630,lag=1
master_repl_offset:269174630
repl_backlog_active:1
repl_backlog_size:1048576
repl_backlog_first_byte_offset:268126055
repl_backlog_histlen:1048576

Master gets 2 requests per second. 

The difference between master_repl_offset and slave offset is 48144 in use case 1 and 0 in use case 2. 

When I am monitoring multiple un-related redis use cases, is there a reasonable difference in offsets beyond which I should raise the alarm? 

Is the difference number of bytes? Even when user writes no bytes to redis, why do these offset numbers keep increasing?

Fei Ding

unread,
Sep 5, 2017, 3:51:57 AM9/5/17
to Redis DB


在 2017年9月2日星期六 UTC+8上午9:54:52,Vishy Kasar写道:
 
Even when user writes no bytes to redis, why do these offset numbers keep increasing?


There are commands that the master send to slave(s) automatically, such as PING, and they will be copied into backlog.

Vishy Kasar

unread,
Sep 5, 2017, 6:00:33 PM9/5/17
to Redis DB
Is there a reason to copy commands such as PING that do not change redis state  to backlog?
Reply all
Reply to author
Forward
0 new messages