From 116e9fad86835cbbbe0a724488268a8cad2a184d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 17 Jan 2024 10:53:20 +0200 Subject: [PATCH] Minor cleanups --- docs/maintenance-synapse.md | 2 +- roles/custom/matrix-synapse/defaults/main.yml | 3 +-- .../custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/maintenance-synapse.md b/docs/maintenance-synapse.md index ed1dee7c2..23fd0fd38 100644 --- a/docs/maintenance-synapse.md +++ b/docs/maintenance-synapse.md @@ -74,7 +74,7 @@ Synapse's presence feature which tracks which users are online and which are off If you have enough compute resources (CPU & RAM), you can make Synapse better use of them by [enabling load-balancing with workers](configuring-playbook-synapse.md#load-balancing-with-workers). -Tuning Synapse's cache factor can help reduce RAM usage. [See the upstream documentation](https://github.com/element-hq/synapse#help-synapse-is-slow-and-eats-all-my-ram-cpu) for more information on what value to set the cache factor to. Use the variable `matrix_synapse_caches_global_factor` to set the cache factor. +Tuning Synapse's cache factor can help reduce RAM usage. Use the variable `matrix_synapse_caches_global_factor` to set the cache factor. [Tuning your PostgreSQL database](maintenance-postgres.md#tuning-postgresql) could also improve Synapse performance. The playbook tunes the integrated Postgres database automatically, but based on your needs you may wish to adjust tuning variables manually. If you're using an [external Postgres database](configuring-playbook-external-postgres.md), you will aslo need to tune Postgres manually. diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index ae5a0335f..2387d11bd 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -548,8 +548,7 @@ matrix_synapse_event_cache_size: "100K" # Raise this to increase cache sizes or lower it to potentially lower memory use. # To learn more, see: # - https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#caching -# - https://github.com/element-hq/synapse#help-synapse-eats-all-my-ram -# - https://github.com/element-hq/synapse/issues/3939 +# - https://github.com/matrix-org/synapse/issues/3939 matrix_synapse_caches_global_factor: 10 matrix_synapse_caches_expire_caches: true matrix_synapse_caches_cache_entry_ttl: "30m" diff --git a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 index f62318739..71c7606ce 100644 --- a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -760,7 +760,7 @@ federation_domain_whitelist: {{ matrix_synapse_federation_domain_whitelist|to_js # The number of events to cache in memory. Not affected by # caches.global_factor. # -event_cache_size: "{{ matrix_synapse_event_cache_size }}" +event_cache_size: {{ matrix_synapse_event_cache_size | to_json }} caches: # Controls the global cache factor, which is the default cache factor