From 04b9e8bec239d82a98cc8b6c654ad5b64f4b869f Mon Sep 17 00:00:00 2001
From: reivilibre
Normally, only a couple of changes are needed to make an existing configuration -file suitable for use with workers. First, you need to enable an +
Normally, only a few changes are needed to make an existing configuration +file suitable for use with workers:
+instance_map
+with the main
process defined, as well as the relevant connection information from
+it's HTTP replication
listener (defined in step 1 above). Note that the host
defined
+is the address the worker needs to look for the main
process at, not necessarily the same address that is bound to.# extend the existing `listeners` section. This defines the ports that the
# main process will listen on.
listeners:
@@ -231,6 +239,11 @@ worker_replication_secret: ""
redis:
enabled: true
+
+instance_map:
+ main:
+ host: 'localhost'
+ port: 9093
See the configuration manual for the full documentation of each option.
@@ -247,22 +260,18 @@ is configuredworker_app
).
The currently available worker applications are listed below.worker_name
).worker_replication_host
and
-worker_replication_http_port
).worker_listeners
option
with an http
listener.^/_matrix/client/v3/keys/upload
endpoint, the HTTP URI for
the main process (worker_main_http_uri
). This config option is no longer required and is ignored when running Synapse 1.73 and newer.worker_replication_host
and
+worker_replication_http_port
). If using Synapse 1.84 and newer, these are not needed if main
is defined on the shared configuration instance_map
For example:
worker_app: synapse.app.generic_worker
worker_name: generic_worker1
-# The replication listener on the main synapse process.
-worker_replication_host: 127.0.0.1
-worker_replication_http_port: 9093
-
worker_listeners:
- type: http
port: 8083
@@ -516,15 +525,22 @@ effects of bursts of events from that bridge on events sent by normal users.
Stream writers
Additionally, the writing of specific streams (such as events) can be moved off
of the main process to a particular worker.
-To enable this, the worker must have a
-HTTP replication
listener configured,
-have a worker_name
+
To enable this, the worker must have:
+
+- An HTTP
replication
listener configured,
+- Have a
worker_name
and be listed in the instance_map
-config. The same worker can handle multiple streams, but unless otherwise documented,
+config.
+- Have the main process declared on the
instance_map
as well.
+
+Note: The same worker can handle multiple streams, but unless otherwise documented,
each stream can only have a single writer.
For example, to move event persistence off to a dedicated worker, the shared
configuration would include:
instance_map:
+ main:
+ host: localhost
+ port: 8030
event_persister1:
host: localhost
port: 8034
--
cgit 1.5.1