Matheus Melo
Matheus Melo

Reputation: 105

Config Redis to use disk automatically

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

Answers (2)

shaoyihe
shaoyihe

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 : RocksDBLevelDB

Upvotes: 0

Mark Bramnik
Mark Bramnik

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

Related Questions