From f847f63f04d7feb959b1b19b8c5d50b017360770 Mon Sep 17 00:00:00 2001 From: Hans van Zijst Date: Wed, 11 Dec 2024 10:45:21 +0100 Subject: [PATCH] Had to go in the workers.md file of course. --- matrix/synapse/README.md | 66 ---------------------------------- matrix/synapse/temp | 64 +++++++++++++++++++++++++++++++++ matrix/synapse/workers.md | 74 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 66 deletions(-) create mode 100644 matrix/synapse/temp diff --git a/matrix/synapse/README.md b/matrix/synapse/README.md index 0187357..c93f3fe 100644 --- a/matrix/synapse/README.md +++ b/matrix/synapse/README.md @@ -640,69 +640,3 @@ 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 -``` - diff --git a/matrix/synapse/temp b/matrix/synapse/temp new file mode 100644 index 0000000..8cc6d76 --- /dev/null +++ b/matrix/synapse/temp @@ -0,0 +1,64 @@ +## 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 +``` + diff --git a/matrix/synapse/workers.md b/matrix/synapse/workers.md index 3c2206b..cf7c4f1 100644 --- a/matrix/synapse/workers.md +++ b/matrix/synapse/workers.md @@ -151,3 +151,77 @@ After=network.target [Install] WantedBy=multi-user.target ``` + + +# Create workers + +We need a configuration file for each worker, and the main process needs to +know which workers there are and how to contact them. + +The latter is done in the ... + + +## 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 +``` +