We are using Redis as a Queue which has on an average about ~3k rps. But when we check the instantaneous_ops_per_sec, this value consistently reports higher than expected, by about 20%, in this case, reports ~4k ops per sec.

To verify this, I have taken a dump of MONITOR for about 10 seconds and checked the number of incoming commands. grep "1489722862." monitor_output | wc -l

Where 1489722862 is the timestamp. Even this count matches with what is being produced in the queue and what is being consumed from the queue. This is a master-slave redis cluster setup. Does instantaneous_ops_per_sec also account for the slave reads? If not, what is the other reason for which this count is significantly higher?

Comment From: itamarhaber

The instantaneous_ops_per_sec metric is calculated as the mean of the recent samples that the server took. The number of recent samples is hardcoded as 16 by STATS_METRIC_SAMPLES in server.h.

Comment From: oranagra

to elaborate, this metric counts the the ops of the last 1.6 seconds (16 averages that are collected every 100ms). it does not include replica traffic. if you believe there's a bug, please provide evidence and a way to reproduce.