Skip to content

Commit 142977a

Browse files
Apply suggestions from code review
Co-authored-by: David Buchmann <david@liip.ch>
1 parent 0840361 commit 142977a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

components/cache/adapters/redis_adapter.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,12 @@ In order to use tag-based invalidation, you can wrap your adapter in :class:`Sym
204204
Configuring Redis
205205
~~~~~~~~~~~~~~~~~
206206

207-
When redis is used as cache its recommended to configure the `maxmemory` and `maxmemory-policy`
208-
read more about this topic in the offical `Redis LRU Cache Documentation`_. Normally the redis
209-
config can be found int `/etc/redis/redis.conf`. The `maxmemory` depend on the usage of the cache
210-
to low it could kickout things which could be still important, to high could end in using too
211-
much memory:
207+
When using Redis as cache, you should configure the `maxmemory` and `maxmemory-policy` settings.
208+
Read more about this topic in the offical `Redis LRU Cache Documentation`_.
209+
By setting `maxmemory`, you limit how much memory Redis is allowed to consume. If the amount is too low, Redis will drop entries that would still be useful and you benefit less from your cache. Setting the `maxmemory-policy` to
210+
`allkeys-lru` tells Redis that it is ok to drop data when it runs out of memory, and to first drop the oldest entries (least
211+
recently used). If you do not allow Redis to drop entries, it will return an error when you try to add data when no
212+
memory is available. An example setting could look as follows:
212213

213214
maxmemory 100mb
214215
maxmemory-policy allkeys-lru

0 commit comments

Comments
 (0)