Reputation: 105
I need to setup a caching system which is able to cache some GBs of data without consuming too much RAM. Is there a wat to configure Redis to use disk storage automatically when reaching X RAM usage? If not, is there any in-memory database in which this is possible?
Upvotes: 0
Views: 515
Reputation: 1087
No , You can't .
Redis store all data in memory , all disk storages are just for restore .
Maybe you can try other k-v store , eg : RocksDB
、LevelDB
。
Upvotes: 0
Reputation: 42431
If you need a caching system, why do you want to spill over to disk and not just remove (probably old and not used) entries from the cache?
Redis has various strategies when memory reaches some limits...
Please read Redis documentation about memory configuration and eviction policies
Bottom line in redis.conf
its possible to configure memory limits and a policy of caching (probably volatile-lru
or allkey-lru
will help here)
Upvotes: 2