聊一聊Redis内存碎片清理( 二 )

6、手动清理其实还可以手动清理,可以采用如下命令
127.0.0.1:6379> memory purge7、相关参数配置说明内存清理相关参数如下,可以使用config get的方式查看对应的值 。
# Enabled active defragmentation# 碎片整理总开关# activedefrag yes# Minimum amount of fragmentation waste to start active defrag# 内存碎片达到多少的时候开启整理active-defrag-ignore-bytes 100mb# Minimum percentage of fragmentation to start active defrag# 碎片率达到百分之多少开启整理active-defrag-threshold-lower 10# Maximum percentage of fragmentation at which we use maximum effort# 碎片率小余多少百分比开启整理active-defrag-threshold-upper 100# Minimal effort for defrag in CPU percentageactive-defrag-cycle-min 25# Maximal effort for defrag in CPU percentageactive-defrag-cycle-max 75至此,Redis4.0.14版本的内存碎片清理就测试完成了 。




推荐阅读