maxmemory setting

47 views
Skip to first unread message

Ajay Thakur

unread,
Dec 3, 2018, 5:52:52 AM12/3/18
to to: Redis DB
HI All,
I have couple of doubts around max memory config.  I am using redis-server in the cluster mode with  3+3. ( 3 master nodes & 3 replicas).  I have also enabled persistence ( both AOF + RDB).  I wonder if i can use maxmemory setting to protect my database in getting into out of memory situation.

But i am not clear on how max memory is used by redis-server internally. My rdb file & AOF file size is also considered part of max memory ? or they are not part of it.

Any help would be highly appreciated.

Thanks
Ajay



--
B Good. !

hva...@gmail.com

unread,
Dec 4, 2018, 1:06:50 PM12/4/18
to Redis DB
Redis uses the strict definition of "memory", meaning RAM.  Many people refer to a computer's disk storage as "memory" which is very inaccurate.  Disk is disk.  Memory is RAM.

RDB and AOF are files on disk.  Since they are not stored in RAM, they do not count against Redis's maxmemory limit.
(you could set up a ramdisk and configure Redis to save its RDB/AOF files there, and therefore be consuming RAM/memory with them, but that defeats the point of having RDB/AOF files, and Redis would still not count them against maxmemory)

The things that Redis counts against its maxmemory limit are only the keys/values it holds in its data store in RAM.  Setting maxmemory can be a reasonable way to avoid your Redis RAM consumption from growing too large for the server, but it's important to read the whole section of comments in the source code's example redis.conf file to understand the other configuration parameters that give Redis the power to reduce its RAM consumption when the maxmemory limit is reached.

Ajay Thakur

unread,
Dec 5, 2018, 2:10:47 AM12/5/18
to to: Redis DB
Thanks for your email. I am clear about what's counted against maxmemory.  2 more questions on the same topic
1. In case someone is using diskless replication, do we still exclude in-memory rdb file ?
2. I am not sure if aof is replicated to slave node or its recreated at the slave node once rdb is available.

Thanks
Ajay



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.


--
B Good. !
Reply all
Reply to author
Forward
0 new messages