Skip to content

Commit

Permalink
Mention that eviction policies use approximated randomized algorithms (
Browse files Browse the repository at this point in the history
…#144)

We clearly indicate in the documentation that LRU / LFU are using
approximated randomized algorithms. Some people think volatile-ttl
is accurate, i suppose adding this sentence will be helpful, the text
is from valkey.conf

Signed-off-by: Binbin <binloveplay1314@qq.com>
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
  • Loading branch information
enjoy-binbin and zuiderkwast committed Jun 17, 2024
1 parent a5406a0 commit a18bd47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions topics/lru-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ The following policies are available:

The policies **volatile-lru**, **volatile-lfu**, **volatile-random**, and **volatile-ttl** behave like **noeviction** if there are no keys to evict matching the prerequisites.

**LRU**, **LFU** and **volatile-ttl** are implemented using approximated randomized algorithms.

Picking the right eviction policy is important depending on the access pattern
of your application, however you can reconfigure the policy at runtime while
the application is running, and monitor the number of cache misses and hits
Expand Down

0 comments on commit a18bd47

Please sign in to comment.