From 7c0a93f5ec3a0ff27839acfb2ea92407accf220c Mon Sep 17 00:00:00 2001
From: Hans van Zijst <hans@procolix.com>
Date: Wed, 11 Dec 2024 10:41:50 +0100
Subject: [PATCH] Documenting individual workers.

---
 matrix/synapse/README.md | 66 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/matrix/synapse/README.md b/matrix/synapse/README.md
index c93f3fe3..01873578 100644
--- a/matrix/synapse/README.md
+++ b/matrix/synapse/README.md
@@ -640,3 +640,69 @@ new policy.
 
 The options `server_notice_content` and `block_events_error` do not seem to be
 used, this is something that needs to be investigated.
+
+
+## Temporary block
+
+We're going to configure a few different workers:
+
+* client-sync
+* roomworker
+* federation-sender
+* mediaworker
+
+
+### Client-sync
+
+This type needs both an inbound socket to receive stuff from nginx, and a
+replication socket to communicate with the rest. We probably want a few of
+these workers. The configuration should look like this:
+
+```
+worker_app: "synapse.app.generic_worker" # Always this unless
+"synapse.app.media_repository"
+worker_name: "clientsync1" # Name of worker specified in instance map
+worker_log_config: "/data/log.config/client_sync.log.config" # Log config file
+
+worker_listeners:
+  # Include for any worker in the instance map above:
+  - path: "/run/matrix-synapse/replication_clientsync1.sock"
+    type: http
+    resources:
+      - names: [replication]
+        compress: false
+  # Include for any worker that receives requests in Nginx:
+  - path: "/run/matrix-synapse/synapse_inbound_client_sync1.sock"
+    type: http
+    x_forwarded: true # Trust the X-Forwarded-For header from Nginx
+    resources:
+      - names:
+        - client
+        - consent
+```
+
+### Roomworker
+
+These don't need a replication socket as they're not in the instance map, but
+they do need an inboud socket for nginx to pass stuff to them. We want a few
+of these workers, we may even configure a worker for one specific busy room...
+
+Configuration should look like this:
+
+```
+worker_app: "synapse.app.generic_worker"
+worker_name: "roomworker1"
+worker_log_config: "/data/log.config/rooms.log.config"
+
+worker_listeners:
+  - path: "/run/matrix-synapse/inbound_roomworker1.sock"
+    type: http
+    x_forwarded: true
+    resources:
+      - names:
+        - client
+        - consent
+        - federation
+        compress: false
+```
+