尽pipe我们的保存操作被设置为每15分钟发生一次,但我们仍然看到来自redis服务器的IO负载。
工作量是一个“整页caching”; 我们存储压缩的HTML blob。 如果需要的话,HTML可以重新创build,因此我们不需要最新的备份/持久性。
服务器规格:
2x Hex Core Intel Xeon E5-2640 2.5GHz 128GB RAM 2x 400GB Intel SSDs in RAID 1
IO:
# pidstat -d | grep redis 05:01:35 PM PID kB_rd/s kB_wr/s kB_ccwr/s Command 05:01:35 PM 23450 0.01 3981.60 0.00 redis-server
redis保存configuration:
redis 127.0.0.1:6379> config get save 1) "save" 2) "900 10000"
redis appendfsyncconfiguration:
redis 127.0.0.1:6379> config get appendfsync 1) "appendfsync" 2) "no"
从手册
RDB最大限度地提高了Redis的性能,因为Redis父级进程需要做的唯一工作就是坚持让一个孩子完成剩下的工作。 父实例永远不会执行磁盘I / O或类似的。
因此,当存在临时subprocess来执行后台保存操作时,我只会期望来自Redis的高IO。
从我们的Redis日志中,关于后台保存:
# tail /var/log/redis/redis.log [23450] 27 Aug 16:43:20 * 10000 changes in 900 seconds. Saving... [23450] 27 Aug 16:43:20 * Background saving started by pid 47396 [47396] 27 Aug 16:44:28 * DB saved on disk [23450] 27 Aug 16:44:29 * Background saving terminated with success [23450] 27 Aug 16:59:30 * 10000 changes in 900 seconds. Saving... [23450] 27 Aug 16:59:30 * Background saving started by pid 4722 [4722] 27 Aug 17:00:40 * DB saved on disk [23450] 27 Aug 17:00:40 * Background saving terminated with success
每900秒运行一次(15分钟),大约需要1分钟执行。
我怎样才能进一步debugging呢?