Redis instantaneous_ops_per_sec高于实际吞吐量

时间:2017-03-17 06:08:22

标签: redis redis-cluster

我们使用Redis作为一个平均约 ~3k rps 的队列。但是当我们检查instantaneous_ops_per_sec时,这个值一直报告高于预期,大约20%,在这种情况下,报告每秒约4k操作。

为了验证这一点,我已经进行了大约10秒的MONITOR转储,并检查了传入命令的数量。

grep "1489722862." monitor_output | wc -l

其中1489722862是时间戳。甚至此计数也与队列中生成的内容以及队列中消耗的内容相匹配。 这是主从redis群集设置。 instantaneous_ops_per_sec 是否也考虑了从属读取?如果不是,这个计数明显更高的另一个原因是什么?

1 个答案:

答案 0 :(得分:0)

var cron = require('node-schedule'); cron.scheduleJob('*/1 * * * * *', function() { console.log('This runs at the 30th mintue of every hour. FROM NODE SCHEDULE'); async.eachSeries(directories, function(dir, cb1) { var dir = __dirname + dir; console.log('reading', dir); // get files for the directory fs.readdir(dir, function(err, files) { if (err) return cb1(err); // loop through each file async.eachSeries(files, function(file, cb2) { var filePath = path.resolve(dir + '/' + file); // get info for the file fs.stat(filePath, function(err, stats) { if (err) return cb2(err); var fileInfo = { fileDate: stats.birthtime, filename: file }; console.log('fileInfo', fileInfo); compareDates(fileInfo, filePath); cb2(null, fileInfo); }); }, cb1); }); }); }); 指标计算为服务器最近采样的平均值。最近的样本数量在instantaneous_ops_per_sec中由STATS_METRIC_SAMPLES硬编码为16。

相关问题