Problem:
We currently use heaps for our LFU and LRU eviction rules. We do not use a heap with simple TTL.
In the evictKeysWithExpiredTTL method, the key eviction process is:
- based on sample size, iterate through the
keysWithExpiry map sampleSize times and pseudo random keys to an array
- iterate through this array, check if the keys expired, and delete the key
This process also has the potential to keep live what should be evicted keys.
Proposed Solution:
Utilizing a min heap instead would simplify this process and allow it to scale more efficiently.
Problem:
We currently use heaps for our LFU and LRU eviction rules. We do not use a heap with simple TTL.
In the
evictKeysWithExpiredTTLmethod, the key eviction process is:keysWithExpirymap sampleSize times and pseudo random keys to an arrayThis process also has the potential to keep live what should be evicted keys.
Proposed Solution:
Utilizing a min heap instead would simplify this process and allow it to scale more efficiently.