# 设置后台启动
daemonize yes
# 开启保护模式
protected-mode yes
# 根目录文件件
dir "/home/redis/redis-4.0.10/data"
# pid文件存放位置
pidfile "/home/redis/redis-4.0.10/run/redis.pid"
# 绑定ip
bind 0.0.0.0
# 绑定端口
port 6379
# 当客户端空闲时自动关闭连接的时间,0:永远不关闭
timeout 0
#
tcp-keepalive 0
loglevel notice
# 日志位置
logfile "/home/redis/redis-4.0.10/logs/redis.log"
databases 16
# Snapshotting
save 900 1
save 300 10
save 60 10000
# 停止写操作当bgsave错误
stop-writes-on-bgsave-error yes
# 开启rdb压缩
rdbcompression yes
# 开启rdb校验
rdbchecksum yes
# rdb的导出位置
dbfilename "dump.rdb"
# Limits 最大客户端
maxclients 10000
# allkeys volatile allkeys random
maxmemory-policy noeviction
# Security
#当前redis密码
#requirepass redis123456
# Replication
slave-serve-stale-data yes
slave-read-only yes
repl-disable-tcp-nodelay no
slave-priority 98
min-slaves-max-lag 10
#masterauth redis123456
# Append Only Mode
appendonly yes
# appendfsync always
appendfsync everysec
# appendfsync no
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
# Lua 脚本时间限制
lua-time-limit 5000
# Slow Log
slowlog-log-slower-than 10000
slowlog-max-len 128
# Event Notification
notify-keyspace-events ""
# Advanced
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes