redis version:4.0.14 maxmemory_policy:noeviction maxmemory_human:37.25G aof_enabled:0

Master(21G): Redis master's memory is 21G but some slave's memory is 12G or 21G

Redis master's memory is 21G but some slave's memory is 12G or 21G

Slave(12G): Redis master's memory is 21G but some slave's memory is 12G or 21G Redis master's memory is 21G but some slave's memory is 12G or 21G

I execute bgsave on master and create a new node loding master's dump file,the memory display 12G I add a new slave from master.the slave's memory display 21G what's the problem ? please help me !!!

Comment From: charsyam

@david6522-man It is possible, You have lots of expire keys. and Redis will remove expired key when it accesses the keys.

Comment From: david6522-man

@david6522-man It is possible, You have lots of expire keys. and Redis will remove expired key when it accesses the keys.

but when i use rdr tools to analyse master and slave's dump file , all display about 20G memory ,and i see master have about 20w expired keys , totol keys about 950w , also HZ set 500 Redis master's memory is 21G but some slave's memory is 12G or 21G

Comment From: madolson

@david6522-man Can you clarify if all the slaves that you startup have 12Gb, it sounds like you said some are using 21 GB. The two modes you mentioned should both produce identical RDB files, so there should be no difference in memory usage.

One thing worth nothing about Redis is that replicas can use less memory than there masters since are multiple ways to store the same set of data within Redis. It doesn't sound like that is the case you are running into.

Comment From: david6522-man

@david6522-man Can you clarify if all the slaves that you startup have 12Gb, it sounds like you said some are using 21 GB. The two modes you mentioned should both produce identical RDB files, so there should be no difference in memory usage.

One thing worth nothing about Redis is that replicas can use less memory than there masters since are multiple ways to store the same set of data within Redis. It doesn't sound like that is the case you are running into.

it's true that some slave node have 12GB and others have 21GB ,when i add a new slave from master.the slave's memory display 21G as the same as the master

Comment From: david6522-man

@david6522-man It is possible, You have lots of expire keys. and Redis will remove expired key when it accesses the keys.

we only have 20w expire keys ,the total keys is about 950w