From 94ba0c55880f7bdefa1e9c264f52e70b54395003 Mon Sep 17 00:00:00 2001
From: squahtx
worker_replication_host
and worker_replication_http_port
)worker_listeners
option with an http
-listener, in the same way as the listeners
option in the shared config.listeners
+option in the shared config.
^/_matrix/client/v3/keys/upload
endpoint, the HTTP URI for
the main process (worker_main_http_uri
).Note that a HTTP listener with client
and federation
resources must be
-configured in the worker_listeners
option in the worker config.
Note that a HTTP listener
+with client
and federation
resources
must be configured in the worker_listeners
+option in the worker config.
It is possible to run multiple instances of this worker app, with incoming requests being load-balanced between them by the reverse-proxy. However, different endpoints @@ -431,7 +433,8 @@ effects of bursts of events from that bridge on events sent by normal users.
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, +
To enable this, the worker must have a
+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, each stream can only
have a single writer.
presence
stream:
There is also support for moving background tasks to a separate worker. Background tasks are run periodically or started via replication. Exactly which tasks are configured to run depends on your Synapse configuration (e.g. if -stats is enabled).
+stats is enabled). This worker doesn't handle any REST endpoints itself.To enable this, the worker must have a worker_name
and can be configured to run
background tasks. For example, to move background tasks to a dedicated worker,
the shared configuration would include:
This style of configuration supersedes the legacy synapse.app.user_dir
worker application type.
You can designate one generic worker to send output traffic to Application Services.
-Specify its name in the shared configuration as follows:
+You can designate one generic worker to send output traffic to Application Services. +Doesn't handle any REST endpoints itself, but you should specify its name in the +shared configuration as follows:
notify_appservices_from_worker: worker_name
This work cannot be load-balanced; please ensure the main process is restarted @@ -601,14 +605,23 @@ For example:
file to stop the main synapse running background jobs related to managing the media repository. Note that doing so will prevent the main process from being able to handle the above endpoints. -In the media_repository
worker configuration file, configure the http listener to
+
In the media_repository
worker configuration file, configure the
+HTTP listener to
expose the media
resource. For example:
worker_listeners:
- - type: http
- port: 8085
- resources:
- - names:
- - media
+worker_app: synapse.app.media_repository
+worker_name: media_worker
+
+# 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: 8085
+ resources:
+ - names: [media]
+
+worker_log_config: /etc/matrix-synapse/media-worker-log.yaml
Note that if running multiple media repositories they must be on the same server
and you must configure a single instance to run the background tasks, e.g.:
--
cgit 1.4.1