summary refs log tree commit diff
path: root/synapse/config/server.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2020-05-07 11:35:23 +0200
committerGitHub <noreply@github.com>2020-05-07 10:35:23 +0100
commitd9b8d274949df7356e880a67d3aac1b25613ab1f (patch)
tree8f2af8762b9e13eec493e288c9a7b6c5c55892bb /synapse/config/server.py
parentImprove per-block CPU and DB usage metrics (#7426) (diff)
downloadsynapse-d9b8d274949df7356e880a67d3aac1b25613ab1f.tar.xz
Add a configuration setting for the dummy event threshold (#7422)
Add dummy_events_threshold which allows configuring the number of forward extremities a room needs for Synapse to send forward extremities in it.
Diffstat (limited to 'synapse/config/server.py')
-rw-r--r--synapse/config/server.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py
index c6d58effd4..6d88231843 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -505,6 +505,9 @@ class ServerConfig(Config):
             "cleanup_extremities_with_dummy_events", True
         )
 
+        # The number of forward extremities in a room needed to send a dummy event.
+        self.dummy_events_threshold = config.get("dummy_events_threshold", 10)
+
         self.enable_ephemeral_messages = config.get("enable_ephemeral_messages", False)
 
         # Inhibits the /requestToken endpoints from returning an error that might leak
@@ -823,6 +826,18 @@ class ServerConfig(Config):
           #  bind_addresses: ['::1', '127.0.0.1']
           #  type: manhole
 
+        # Forward extremities can build up in a room due to networking delays between
+        # homeservers. Once this happens in a large room, calculation of the state of
+        # that room can become quite expensive. To mitigate this, once the number of
+        # forward extremities reaches a given threshold, Synapse will send an
+        # org.matrix.dummy_event event, which will reduce the forward extremities
+        # in the room.
+        #
+        # This setting defines the threshold (i.e. number of forward extremities in the
+        # room) at which dummy events are sent. The default value is 10.
+        #
+        #dummy_events_threshold: 5
+
 
         ## Homeserver blocking ##