I setup a Redis (version 4.0.6) sentinel cluster in two centos 6 VMs. Both master and slave Redis server has maxmemory set to 10GB and maxmemory_policy as volatile-lru.
The problem is, both servers are taking alot of memory.
Master:
# Memory
used_memory:9939524616
used_memory_human:9.26G
used_memory_rss:11554213888
used_memory_rss_human:10.76G
used_memory_peak:10001440960
used_memory_peak_human:9.31G
used_memory_peak_perc:99.38%
used_memory_overhead:1469809500
used_memory_startup:761776
used_memory_dataset:8469715116
used_memory_dataset_perc:85.22%
total_system_memory:20957556736
total_system_memory_human:19.52G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:10000000000
maxmemory_human:9.31G
maxmemory_policy:volatile-lru
mem_fragmentation_ratio:1.16
mem_allocator:jemalloc-3.6.0
active_defrag_running:0
lazyfree_pending_objects:0
Slave:
# Memory
used_memory:9930822872
used_memory_human:9.25G
used_memory_rss:12246667264
used_memory_rss_human:11.41G
used_memory_peak:9999999848
used_memory_peak_human:9.31G
used_memory_peak_perc:99.31%
used_memory_overhead:1468959861
used_memory_startup:761792
used_memory_dataset:8461863011
used_memory_dataset_perc:85.21%
total_system_memory:20957556736
total_system_memory_human:19.52G
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:10000000000
maxmemory_human:9.31G
maxmemory_policy:volatile-lru
mem_fragmentation_ratio:1.23
mem_allocator:jemalloc-3.6.0
active_defrag_running:0
lazyfree_pending_objects:0
I did run MEMORY PURGE
which clears some of the rss memory but it gets re populated within a few minutes and keeps growing.
Most of my data stored in Redis has expiry time although some keys have no expiry set.
Any suggestion on how I can control the memory consumption or a permanent solution for this issue. Should I just increase the RAM on the VMs? I do run other applications on both of the VMs but they take hardly 100 MB of memory.