简体   繁体   中英

Why data is not getting persisted on disk when memory is full in redis?

In redis.conf file we have set max memory policy to eviction policy to allkeys-random and allocated 4GB as max memory. We inserted 5 million keys but when we actually checked the dbsize it only showed about 2.5 million only.

So I have a question, does eviction policy removes keys from only memory or disk?

Ideally whenever given maxmemory is full, the keys selected for eviction should be flushed to disk so that they can be retrieved later from disk whenever required.

Conf file comments only mentions that keys will be removed, but it doesn't tell if they are removed from only memory or also from disk ie persistant store.

Thanks.

Evicted keys are removed from memory. Disk snapshot is not touched. However, values on disk will also be gone when next snapshot is made.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM