4

Which of these can be considered to monitor replication delay ? Redis_master_repl_offset, Redis_master_last_io_seconds_ago , Redis_slave_repl_offset

karan sindwani
  • 53
  • 1
  • 1
  • 7
  • Please read the manual before asking questions. http://redis.io/commands/INFO. (last_io) and http://redis.io/topics/replication (offset). – Jeroen Feb 16 '16 at 13:12
  • How can i say according to the above mentioned parameters that there is a delay ? – karan sindwani Feb 16 '16 at 13:39
  • @Jeroen The given commands do not yield a replication-delay. What they do show is last-io-from-partner, which is not the same thing. – sysadmin1138 Feb 16 '16 at 13:42
  • You can monitor the repl_backlog_active (manual is in the config http://download.redis.io/redis-stable/redis.conf) – Jeroen Feb 16 '16 at 13:43

1 Answers1

8

Given results from an INFO replication command like this:

slave0:172.16.101.23,6380,online,424821
master_repl_offset:424827

You can tell that slave0 is behind master by 6. This is the difference between the master_repl_offset and the offset value in the slave0 line, which is the last number in it. If you have multiple slaves, each will get their own line with their own offset value.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • What does value indicate ? What can be the threshold of a warning value ? – karan sindwani Feb 17 '16 at 12:04
  • @karansindwani I believe the value there is `bytes`. I used small numbers here as an example, real ones would likely be very large. On our logstash redis instance, 1MB is a sign of pressure worthy of notice, but on an application-stack redis, even 20KB is considered slow. It depends, and only you can know what bad looks like. – sysadmin1138 Feb 17 '16 at 13:22
  • For me the output looks like this `slave0:ip=10.0.1.162,port=6379,state=online,offset=925994074541,lag=0` so I'm looking at offset? – radtek Sep 28 '17 at 23:40
  • 1
    @radtek Yes, offset. – sysadmin1138 Sep 29 '17 at 15:55