Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Expand and improve workers documentation and example configuration #9072

Open
2 tasks
ShadowJonathan opened this issue Jan 11, 2021 · 13 comments
Open
2 tasks
Labels
A-Docs things relating to the documentation A-Workers Problems related to running Synapse in Worker Mode (or replication) S-Minor Blocks non-critical functionality, workarounds exist. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@ShadowJonathan
Copy link
Contributor

A general call;

  • Add more documentation surrounding workers (just in general)
  • Add example configuration file (a-la sample_config.yaml) for each worker type, or for all workers in one
  • Add docker-compose file that includes ready-to-work example for synapse workers

Imo: Currently i think workers are very hard to set up or figure out on its own, because knowledge of it is mostly limited to large setups, and thus that knowledge is never reflected in documentation, or workers seen as an asset to be documented with the same priority.

@ShadowJonathan ShadowJonathan changed the title Expand and improve workers documentation, add example configuration for each + docker-compose configuration Expand and improve workers documentation and example configuration Jan 11, 2021
@clokep
Copy link
Member

clokep commented Jan 12, 2021

Add more documentation surrounding workers (just in general)

Is there specific information that you think is missing? the workers docs were recently expanded to include a bit more information.

Add example configuration file (a-la sample_config.yaml) for each worker type, or for all workers in one

I think this is pretty much #8557.

Add docker-compose file that includes ready-to-work example for synapse workers

The current docker-compose stuff is under contrib, so I unfortunately this will probably need to be provided via a contribution. 😄

@ShadowJonathan
Copy link
Contributor Author

@clokep why was info-needed added here, i thought i was pretty clear; improve workers documentation and add samples, for the first one there's already an issue (good, cuz then i can track that via here), and for the second one i havent seen a thing (with issue or PR), or should that issue be added to another repo?

@clokep
Copy link
Member

clokep commented Jan 12, 2021

@ShadowJonathan The bit that is unclear to me is:

Add more documentation surrounding workers (just in general)

Is there specific information that you think is missing? the workers docs were recently expanded to include a bit more information.

What information do you feel is missing?

@ShadowJonathan
Copy link
Contributor Author

Oh, that part is a general call for a look at the documentation, but i'm not holding it for a requirement (thus the absence of checkmark), its generally just "hey, please give a look at the documentation for workers and judge if everything you know about setting up and configuring workers is in there" request, should i remove it to avoid confusion?

@richvdh
Copy link
Member

richvdh commented Feb 11, 2021

we certainly need better documentation for how to run workers under docker

@richvdh richvdh added S-Minor Blocks non-critical functionality, workarounds exist. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. A-Docs things relating to the documentation and removed z-info-needed labels Feb 11, 2021
@TheDiscordian
Copy link

I was asked to drop my opinion in here while we were discussing this issue in chat:

There's a lot of info on types of workers, and little on how to redirect queries from a reverse proxy to the workers effectively. I know it sounds simple to say "just run a worker per CPU", but I didn't find my experience to feel quite so clear-cut.

Put simply, an example showing how to run a server with 4+ cores, using Nginx as a reverse proxy, with an appropriate worker setup / Nginx config would go a long way I think.

@ShadowJonathan
Copy link
Contributor Author

Extra thoughts;

  • docker-compose sample
  • full setup sample config

@geier1993
Copy link

The Loadbalancing Section is a little bit confusing.
Is there loadbalancing by default? I read that it is customizable to redirect same users to same nodes, or specific rooms to same nodes.
However is this already working by default, how can I configure it?

At least it should be statet that i need to bring my own load balancer.

@geier1993
Copy link

the main issue I found with the worker docs is they do describe what to do, but not quite how to get there, ie; the keys are noted but not really the surrounding config for context

... asked by @jwh:covert.tel from the discourse on #synapse:matrix.org

@geier1993
Copy link

geier1993 commented Apr 9, 2021

Maybe reference existing helm charts for Kubernetes?

Thes deprecated repo (https://github.com/ananace/matrix-synapse) references

https://gitlab.com/ananace/charts (espacially https://gitlab.com/ananace/charts/-/tree/master/charts/matrix-synapse up to date!)
and
https://github.com/dacruz21/matrix-chart/

At least concerning "large deployments", concrete kubernetes images are very helpful - at least to mention their existence

EDIT: Within the INSTALL.md some docker images and ansible... but these seem to focus on single process instances - multiple workers/processes are not even mentioned here yet

@richvdh richvdh added the A-Workers Problems related to running Synapse in Worker Mode (or replication) label Mar 2, 2022
@dklimpel
Copy link
Contributor

dklimpel commented Apr 12, 2022

I have found some more issues with worker docs:

  1. Is the TCP replication up to date? Is this part of the redis replication or the old TCP replication? -> Remove old-style (direct) TCP replication support #11728
  2. There are more streams than documented. Or are they not all usable in worker?
  • presence_federation
  • pushers
  • presence
  • caches
  • to_device
  • receipts
  • groups
  • push_rules
  • user_signature
  • account_data
  • tag_account_data
  • typing
  • device_lists
  1. The example uses a deprecated worker type federation_reader -> systemd-with-workers talks about federation_reader, which is undocumented #8740
    worker_app: synapse.app.federation_reader
  2. The diagram does not show a connection from Event Persister to main process. But the stream writer for events is a generic_worker and starts only with a connection (worker_replication_host) to main proccess

image

  1. frontend_proxy worker claims it forwards requests to the main process, but it doesn't #3717

@Thumbscrew
Copy link
Contributor

I've raised PR #12737 with some fairly detailed instructions for using Docker Compose to create workers. Please feel free to provide feedback and let me know if this is helpful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Docs things relating to the documentation A-Workers Problems related to running Synapse in Worker Mode (or replication) S-Minor Blocks non-critical functionality, workarounds exist. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

7 participants