dragonfly/tools/eviction
Yue Li 00f1e3d578
feat(server): perform eviction upon memory pressure in cache mode (#2084)
* fixes #1936

Eviction Implementation
This patch provides a very simple eviction implementation for the interface mentioned above. In my opinion, the eviction algorithm approximates an LRU policy given that normal buckets always store the most recently accessed data while stash buckets are holding less active data.

The algorithm first selects a small set of segments as eviction targets. Starting from the last slot of the last stash bucket in each of the segments, we walk backward to evict key-value pairs stored in each visited slot. The eviction stopped either when a target memory release goal or the max number of evicted key-value pairs is reached. Therefore, we can upper bound the eviction time through the following two parameters that can be set when DF starts.  Note that these two parameters could be retrieved and changed by user through CONFIG GET and CONFIG SET commands.

---------

Signed-off-by: Yue Li <61070669+theyueli@users.noreply.github.com>
2023-11-01 11:11:27 -07:00
..
fill_db.py feat(server): perform eviction upon memory pressure in cache mode (#2084) 2023-11-01 11:11:27 -07:00
run_fill_db.sh feat(server): perform eviction upon memory pressure in cache mode (#2084) 2023-11-01 11:11:27 -07:00
stop_fill_db.sh feat(server): perform eviction upon memory pressure in cache mode (#2084) 2023-11-01 11:11:27 -07:00