You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/develop/reference/eviction/index.md
+10-17Lines changed: 10 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,19 +105,13 @@ The following policies are available:
105
105
-`allkeys-lrm`: Evict the [least recently modified](#lrm-eviction) (LRM) keys.
106
106
-`allkeys-lfu`: Evict the [least frequently used](#lfu-eviction) (LFU) keys.
107
107
-`allkeys-random`: Evict keys at random.
108
-
-`volatile-lru`: Evict the least recently used keys that have the `expire` field
109
-
set to `true`.
110
-
-`volatile-lrm`: Evict the least recently modified keys that have the `expire` field
111
-
set to `true`.
112
-
-`volatile-lfu`: Evict the least frequently used keys that have the `expire` field
113
-
set to `true`.
114
-
-`volatile-random`: Evict keys at random only if they have the `expire` field set
115
-
to `true`.
116
-
-`volatile-ttl`: Evict keys with the `expire` field set to `true` that have the
117
-
shortest remaining time-to-live (TTL) value.
118
-
119
-
The `volatile-xxx` policies behave like `noeviction` if no keys have the `expire`
120
-
field set to true, or for `volatile-ttl`, if no keys have a time-to-live value set.
108
+
-`volatile-lru`: Evict the least recently used keys that have an associated expiration (TTL).
109
+
-`volatile-lrm`: Evict the least recently modified keys that have an associated expiration (TTL).
110
+
-`volatile-lfu`: Evict the least frequently used keys that have an associated expiration (TTL).
111
+
-`volatile-random`: Evict keys at random only if they have an associated expiration (TTL).
112
+
-`volatile-ttl`: Evict keys with an associated expiration (TTL) that have the shortest remaining TTL value.
113
+
114
+
The `volatile-xxx` policies behave like `noeviction` if no keys have a TTLvalue set.
121
115
122
116
You should choose an eviction policy that fits the way your app
123
117
accesses keys. You may be able to predict the access pattern in advance
@@ -302,7 +296,7 @@ So basically the factor is a trade off between better distinguishing items with
302
296
303
297
## LRM eviction {#lrm-eviction}
304
298
305
-
Starting with Redis 8.6, the Least Recently Modified (LRM) eviction mode is available. LRM is similar to LRU but only updates the timestamp on write operations, not read operations. This makes it useful for evicting keys that haven't been modified recently, regardless of how frequently they are read.
299
+
Starting with Redis 8.6, the Least Recently Modified (LRM) eviction policy is available. LRM is similar to LRU but only updates the timestamp on write operations, not read operations. This makes it useful for evicting keys that haven't been modified recently, regardless of how frequently they are read.
306
300
307
301
The key difference between LRU and LRM is:
308
302
@@ -311,13 +305,12 @@ The key difference between LRU and LRM is:
311
305
312
306
This distinction makes LRM particularly useful in scenarios where:
313
307
314
-
- You want to preserve frequently read data, even if it's not being modified
315
308
- Your application has a clear distinction between read-heavy and write-heavy workloads
316
309
- You want to evict stale data that hasn't been updated, regardless of read activity
317
310
318
-
To configure the LRM mode, the following policies are available:
311
+
To configure LRM eviction, the following policies are available:
319
312
320
-
*`volatile-lrm` Evict using LRM among the keys with an expire set.
313
+
*`volatile-lrm` Evict using LRM among the keys with an an associated expiration (TTL).
321
314
*`allkeys-lrm` Evict any key using LRM.
322
315
323
316
Like LRU, LRM uses an approximation algorithm that samples a small number of keys at random and evicts the ones with the longest time since last modification. The same `maxmemory-samples` configuration directive that affects LRU performance also applies to LRM.
0 commit comments