feat(redis): allow configuring max allowed memory

This commit is contained in:
Johanna Dorothea Reichmann 2021-10-19 12:14:58 +02:00
parent 6f639e34dc
commit dd5d9a4ee4
No known key found for this signature in database
GPG key ID: 03624C433676E465
2 changed files with 9 additions and 2 deletions

View file

@ -11,6 +11,9 @@ redis_secret: ~
redis_config_bind_ip: "0.0.0.0"
redis_config_unix_socket_path: ~
redis_config_unix_socket_perm: 775
redis_config_max_memory_mb: ~
redis_config_max_memory_policy: ~ # allkeys-lru
# Overwrite per-instance to be able to run many instances on the same host
# prefix should be sth like 'matrix_', modifies mapped directories, container name and uer
redis_prefix: ""

View file

@ -860,7 +860,9 @@ requirepass {{ redis_secret }}
# limit for maxmemory so that there is some free RAM on the system for replica
# output buffers (but this is not needed if the policy is 'noeviction').
#
# maxmemory <bytes>
{% if redis_config_max_memory_mb %}
maxmemory {{ redis_config_max_memory_mb }}M
{% endif %}
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select one from the following behaviors:
@ -891,7 +893,9 @@ requirepass {{ redis_secret }}
#
# The default is:
#
# maxmemory-policy noeviction
{% if redis_config_max_memory_policy %}
maxmemory-policy {{ redis_config_max_memory_policy }}
{% endif %}
# LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can tune it for speed or