From 04b9e8bec239d82a98cc8b6c654ad5b64f4b869f Mon Sep 17 00:00:00 2001 From: reivilibre Date: Tue, 23 May 2023 12:28:29 +0000 Subject: deploy: 5cae9158e67babe0553bc356802495a068222685 --- latest/workers.html | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'latest/workers.html') diff --git a/latest/workers.html b/latest/workers.html index 39584d0da6..58eedb750d 100644 --- a/latest/workers.html +++ b/latest/workers.html @@ -209,13 +209,21 @@ the processes.

need its own configuration file and can take all of its configuration from the shared configuration file.

Shared configuration

-

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:

+
# 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 configured
  • The type of worker (worker_app). The currently available worker applications are listed below.
  • A unique name for the worker (worker_name).
  • -
  • The HTTP replication endpoint that it should talk to on the main synapse process -(worker_replication_host and -worker_replication_http_port).
  • If handling HTTP requests, a worker_listeners option with an http listener.
  • Synapse 1.72 and older: if handling the ^/_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.
  • +
  • Synapse 1.83 and older: The HTTP replication endpoint that the worker should talk to on the main synapse process +(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:

    + +

    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