redis复制的2种方式

前几天遇到一个问题,项目组说使用redis的时候,redis响应很慢。redis配置了主从,内存使用达到15G左右。

按以前的理解配置了主从,最大从在同步数据会慢,主应该不影响。后来仔细看了redis的复制相关的配置,发现一个好玩的地方。

# 1) Disk-backed: The Redis master creates a new process that writes the RDB

#                 file on disk. Later the file is transferred by the parent

#                 process to the slaves incrementally.

# 2) Diskless: The Redis master creates a new process that directly writes the

#              RDB file to slave sockets, without touching the disk at all.

redis配置默认同步方式是Disk-backed,这样就可以理解为什么主会受影响了。可惜没办法在环境中验证。纯属个人意见。