Skip to content

Commit

Permalink
Update redis.conf
Browse files Browse the repository at this point in the history
Signed-off-by: 熊鑫伟 Xinwei Xiong <3293172751NSS@gmail.com>
  • Loading branch information
cubxxw authored Oct 17, 2024
1 parent caf70b6 commit f41e32c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions compose/production/redis/redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ save 300 10
save 60 10000

# 主动整理碎片,优化内存使用
active-defrag yes
activefrag yes

# 调整内存碎片整理的最小阈值和最大阈值
active-defrag-ignore-bytes 100mb
active-defrag-threshold-lower 10
active-defrag-threshold-upper 100
active-defrag-ignore-bytes 200mb
# 内存碎片的空间占比超过系统分配给 Redis 空间的 20% 。
active-defrag-threshold-lower 20
# active-defrag-threshold-upper 100

# 对 RDB 内存快照文件中的 String 对象使用 LZF 算法做压缩。这个非常有用,能大大减少文件大小,受益匪浅呀,建议你开启。
rdbcompression yes

# 从 5.0 版本开始,RDB 文件末尾会写入一个 CRC64 检验码,能起到一定的纠错作用,但是要丢失大约 10% 的性能损失,你可以设置成功 no 关闭这个功能来获得更快的性能。
rdbchecksum yes

# 启用 AOF 持久化: 不启动持久化
appendonly no
Expand Down

0 comments on commit f41e32c

Please sign in to comment.