Memory Requirement

41 views
Skip to first unread message

Santos Das

unread,
Aug 13, 2017, 3:32:26 PM8/13/17
to Redis DB
Hi,

I am using Redis-Cluster. To my understanding, it seems Redis stores the whole data set in RAM.  My question is when does it write to the disk? What configuration is needed to do this, incase the same is supported. What is the performance impact for this?

Thanks, Santos

Jan-Erik Rediger

unread,
Aug 13, 2017, 4:27:16 PM8/13/17
to redi...@googlegroups.com
Redis has two different configurations for persistence.
See the documentation: https://redis.io/topics/persistence
> --
> 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.

hva...@gmail.com

unread,
Aug 13, 2017, 6:22:48 PM8/13/17
to Redis DB
From the description at the top of the project home page at https://redis.io :

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

The "learn more" link at the end of that paragraph leads to the page https://redis.io/topics/introduction , which repeats the same paragraph, and then the third paragraph is:

In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log. Persistence can be optionally disabled, if you just need a feature-rich, networked, in-memory cache.

Yes, by default Redis holds data in memory only.  You can configure Redis to save its data to disk for crash recovery purposes.  The link to the descriptions is available from the above pages on the redis.io site or from janerik's reply in this thread.

VERY IMPORTANT:  Notice I described Redis writing to disk for the purpose of recovering from a crash.  Redis does not write to disk in order to hold more data than will fit in RAM.  You can use Redis Cluster to partition (shard) your data among multiple servers when the data will not fit into a single server's RAM, but each of those Redis processes holds its portion of the data in RAM only.  Writes to disk are only made to allow recovery after a crash.
Reply all
Reply to author
Forward
0 new messages