From 5b2c5a7ad4a1079453bed930fee2fddb057803fe Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Thu, 27 Oct 2022 13:40:31 +0000 Subject: deploy: 1357ae869f279a3f0855c1b1c2750eca2887928e --- .../usage/configuration/config_documentation.html | 177 ++++++++++++++++++--- 1 file changed, 154 insertions(+), 23 deletions(-) (limited to 'develop/usage/configuration/config_documentation.html') diff --git a/develop/usage/configuration/config_documentation.html b/develop/usage/configuration/config_documentation.html index 26432292c8..7c9ed54cb7 100644 --- a/develop/usage/configuration/config_documentation.html +++ b/develop/usage/configuration/config_documentation.html @@ -275,7 +275,7 @@ including _matrix/...). This is the same URL a user might enter into the 'Custom Homeserver URL' field on their client. If you use Synapse with a reverse proxy, this should be the URL to reach Synapse via the proxy. Otherwise, it should be the URL to reach Synapse's client HTTP listener (see -'listeners' below).

+'listeners' below).

Defaults to https://<server_name>/.

Example configuration:

public_baseurl: https://example.com/
@@ -1269,7 +1269,8 @@ when Synapse is started.

Config options related to logging.


log_config

-

This option specifies a yaml python logging config file as described here.

+

This option specifies a yaml python logging config file as described +here.

Example configuration:

log_config: "CONFDIR/SERVERNAME.log.config"
 
@@ -3289,31 +3290,82 @@ mostly related to trace sampling which is documented Workers -

Configuration options related to workers.

+

Coordinating workers

+

Configuration options related to workers which belong in the main config file +(usually called homeserver.yaml). +A Synapse deployment can scale horizontally by running multiple Synapse processes +called workers. Incoming requests are distributed between workers to handle higher +loads. Some workers are privileged and can accept requests from other workers.

+

As a result, the worker configuration is divided into two parts.

+
    +
  1. The first part (in this section of the manual) defines which shardable tasks +are delegated to privileged workers. This allows unprivileged workers to make +request a privileged worker to act on their behalf.
  2. +
  3. The second part +controls the behaviour of individual workers in isolation.
  4. +
+

For guidance on setting up workers, see the worker documentation.

+
+

worker_replication_secret

+

A shared secret used by the replication APIs on the main process to authenticate +HTTP requests from workers.

+

The default, this value is omitted (equivalently null), which means that +traffic between the workers and the main process is not authenticated.

+

Example configuration:

+
worker_replication_secret: "secret_secret"
+
+
+

start_pushers

+

Controls sending of push notifications on the main process. Set to false +if using a pusher worker. Defaults to true.

+

Example configuration:

+
start_pushers: false
+
+
+

pusher_instances

+

It is possible to run multiple pusher workers, +in which case the work is balanced across them. Use this setting to list the pushers by +worker_name. Ensure the main process and all pusher workers are +restarted after changing this option.

+

If no or only one pusher worker is configured, this setting is not necessary. +The main process will send out push notifications by default if you do not disable +it by setting start_pushers: false.

+

Example configuration:

+
start_pushers: false
+pusher_instances:
+  - pusher_worker1
+  - pusher_worker2
+

send_federation

Controls sending of outbound federation transactions on the main process. -Set to false if using a federation sender worker. Defaults to true.

+Set to false if using a federation sender worker. +Defaults to true.

Example configuration:

send_federation: false
 

federation_sender_instances

-

It is possible to run multiple federation sender workers, in which case the -work is balanced across them. Use this setting to list the senders.

+

It is possible to run multiple +federation sender worker, in which +case the work is balanced across them. Use this setting to list the senders.

This configuration setting must be shared between all federation sender workers, and if changed all federation sender workers must be stopped at the same time and then started, to ensure that all instances are running with the same config (otherwise events may be dropped).

Example configuration:

-
federation_sender_instances:
+
send_federation: false
+federation_sender_instances:
   - federation_sender1
 

instance_map

-

When using workers this should be a map from worker name to the -HTTP replication listener of the worker, if configured.

+

When using workers this should be a map from worker_name to the +HTTP replication listener of the worker, if configured. +Each worker declared under stream_writers needs +a HTTP replication listener, and that listener should be included in the instance_map. +(The main process also needs an HTTP replication listener, but it should not be +listed in the instance_map.)

Example configuration:

instance_map:
   worker1:
@@ -3323,8 +3375,10 @@ HTTP replication listener of the worker, if configured.


stream_writers

Experimental: When using workers you can define which workers should -handle event persistence and typing notifications. Any worker -specified here must also be in the instance_map.

+handle writing to streams such as event persistence and typing notifications. +Any worker specified here must also be in the instance_map.

+

See the list of available streams in the +worker documentation.

Example configuration:

stream_writers:
   events: worker1
@@ -3332,22 +3386,15 @@ specified here must also be in the instance_map.


run_background_tasks_on

-

The worker that is used to run background tasks (e.g. cleaning up expired -data). If not provided this defaults to the main process.

+

The worker that is used to run +background tasks (e.g. cleaning up expired data). If not provided this +defaults to the main process.

Example configuration:

run_background_tasks_on: worker1
 

-

worker_replication_secret

-

A shared secret used by the replication APIs to authenticate HTTP requests -from workers.

-

By default this is unused and traffic is not authenticated.

-

Example configuration:

-
worker_replication_secret: "secret_secret"
-

redis

-

Configuration for Redis when using workers. This must be enabled when -using workers (unless using old style direct TCP configuration). +

Configuration for Redis when using workers. This must be enabled when using workers. This setting has the following sub-options:

  • enabled: whether to use Redis support. Defaults to false.
  • @@ -3362,6 +3409,90 @@ localhost and 6379 port: 6379 password: <secret_password>
+
+

Individual worker configuration

+

These options configure an individual worker, in its worker configuration file. +They should be not be provided when configuring the main process.

+

Note also the configuration above for +coordinating a cluster of workers.

+

For guidance on setting up workers, see the worker documentation.

+
+

worker_app

+

The type of worker. The currently available worker applications are listed +in worker documentation.

+

The most common worker is the +synapse.app.generic_worker.

+

Example configuration:

+
worker_app: synapse.app.generic_worker
+
+
+

worker_name

+

A unique name for the worker. The worker needs a name to be addressed in +further parameters and identification in log files. We strongly recommend +giving each worker a unique worker_name.

+

Example configuration:

+
worker_name: generic_worker1
+
+
+

worker_replication_host

+

The HTTP replication endpoint that it should talk to on the main Synapse process. +The main Synapse process defines this with a replication resource in +listeners option.

+

Example configuration:

+
worker_replication_host: 127.0.0.1
+
+
+

worker_replication_http_port

+

The HTTP replication port that it should talk to on the main Synapse process. +The main Synapse process defines this with a replication resource in +listeners option.

+

Example configuration:

+
worker_replication_http_port: 9093
+
+
+

worker_listeners

+

A worker can handle HTTP requests. To do so, a worker_listeners option +must be declared, in the same way as the listeners option +in the shared config.

+

Workers declared in stream_writers will need to include a +replication listener here, in order to accept internal HTTP requests from +other workers.

+

Example configuration:

+
worker_listeners:
+  - type: http
+    port: 8083
+    resources:
+      - names: [client, federation]
+
+
+

worker_daemonize

+

Specifies whether the worker should be started as a daemon process. +If Synapse is being managed by systemd, this option +must be omitted or set to false.

+

Defaults to false.

+

Example configuration:

+
worker_daemonize: true
+
+
+

worker_pid_file

+

When running a worker as a daemon, we need a place to store the +PID of the worker. +This option defines the location of that "pid file".

+

This option is required if worker_daemonize is true and ignored +otherwise. It has no default.

+

See also the pid_file option option for the main Synapse process.

+

Example configuration:

+
worker_pid_file: DATADIR/generic_worker1.pid
+
+
+

worker_log_config

+

This option specifies a yaml python logging config file as described +here. +See also the log_config option option for the main Synapse process.

+

Example configuration:

+
worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml
+
+

Background Updates

Configuration settings related to background updates.


-- cgit 1.5.1