From 7adcdf30407d634e755f511800339c7a448607f2 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 7 Sep 2018 16:13:50 +0300 Subject: [PATCH] Add the ability to control event_cache_size for Synapse I've found the previous 10K default value to be way too low on a bunch of servers I'm running, so it's now up to 100K and made configurable. --- CHANGELOG.md | 7 +++++++ roles/matrix-server/defaults/main.yml | 3 +++ roles/matrix-server/templates/synapse/homeserver.yaml.j2 | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b23ed359..be1364ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # 2018-09-07 +## Events cache size increase and configurability for Matrix Synapse + +The playbook now lets you configure Matrix Synapse's `event_cache_size` configuration via the `matrix_synapse_event_cache_size` playbook variable. + +Previously, this value was hardcoded to `"10K"`. From now on, a more reasonable default of `"100K"` is used. + + ## Password-peppering support for Matrix Synapse The playbook now supports enabling password-peppering for increased security in Matrix Synapse via the `matrix_synapse_password_config_pepper` playbook variable. Using a password pepper is disabled by default (just like it used to be before this playbook variable got introduced) and is not to be enabled/disabled after initial setup, as that would invalidate all existing passwords. diff --git a/roles/matrix-server/defaults/main.yml b/roles/matrix-server/defaults/main.yml index 5143d5c1..923bd1ec 100644 --- a/roles/matrix-server/defaults/main.yml +++ b/roles/matrix-server/defaults/main.yml @@ -71,6 +71,9 @@ matrix_synapse_report_stats: false # Controls password-peppering for Matrix Synapse. Not to be changed after initial setup. matrix_synapse_password_config_pepper: "" +# Controls the number of events that Matrix Synapse caches in memory. +matrix_synapse_event_cache_size: "100K" + # A list of additional "volumes" to mount in the container. # This list gets populated dynamically based on Synapse extensions that have been enabled. # Contains definition objects like this: `{"src": "/outside", "dst": "/inside", "options": "rw|ro|slave|.."} diff --git a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 index 9ee67f1e..f29ea692 100644 --- a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 @@ -186,7 +186,7 @@ database: cp_max: 10 # Number of events to cache in memory. -event_cache_size: "10K" +event_cache_size: "{{ matrix_synapse_event_cache_size }}"