Snapchat / KeyDB

A Multithreaded Fork of Redis
https://keydb.dev
BSD 3-Clause "New" or "Revised" License
11.02k stars 564 forks source link

Fix blocking evictions when flash is enabled #823

Open gloomy-7164 opened 2 months ago

gloomy-7164 commented 2 months ago

In current setup, with flash enabled, each eviction evicts 5% of memory in a blocking and no-bail-out way. For large datasets the eviction will saturate the main thread for seconds and the server is unavailable for both reads and writes.

In my understanding, eviction works very similar with or without flash enabled, since eviction doesn't require any flash db deletions, only in memory data free-up. Therefore it should be fine to evict data just like pure in-memory mode.

https://github.com/Snapchat/KeyDB/issues/814