Skip to content

Commit 628394a

Browse files
committed
Apply review suggestions
1 parent 30bd32e commit 628394a

File tree

1 file changed

+10
-17
lines changed
  • content/develop/reference/eviction

1 file changed

+10
-17
lines changed

content/develop/reference/eviction/index.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,13 @@ The following policies are available:
105105
- `allkeys-lrm`: Evict the [least recently modified](#lrm-eviction) (LRM) keys.
106106
- `allkeys-lfu`: Evict the [least frequently used](#lfu-eviction) (LFU) keys.
107107
- `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.
121115

122116
You should choose an eviction policy that fits the way your app
123117
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
302296

303297
## LRM eviction {#lrm-eviction}
304298

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.
306300

307301
The key difference between LRU and LRM is:
308302

@@ -311,13 +305,12 @@ The key difference between LRU and LRM is:
311305

312306
This distinction makes LRM particularly useful in scenarios where:
313307

314-
- You want to preserve frequently read data, even if it's not being modified
315308
- Your application has a clear distinction between read-heavy and write-heavy workloads
316309
- You want to evict stale data that hasn't been updated, regardless of read activity
317310

318-
To configure the LRM mode, the following policies are available:
311+
To configure LRM eviction, the following policies are available:
319312

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).
321314
* `allkeys-lrm` Evict any key using LRM.
322315

323316
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

Comments
 (0)