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

Shard master process. #7593

Closed
erikjohnston opened this issue May 28, 2020 · 10 comments
Closed

Shard master process. #7593

erikjohnston opened this issue May 28, 2020 · 10 comments
Labels
A-Performance Performance, both client-facing and admin-facing A-Workers Problems related to running Synapse in Worker Mode (or replication) T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@erikjohnston
Copy link
Member

Follows on from: #6677

Now that Synapse supports writing events from a different process, we should look at supporting writing events from multiple processes at once, aka sharding of events stream.

@erikjohnston erikjohnston added A-Performance Performance, both client-facing and admin-facing operation gemini labels May 28, 2020
@djschilling
Copy link

Is there a documentation how this can be achieved?

@erikjohnston
Copy link
Member Author

erikjohnston commented May 29, 2020

https://docs.google.com/document/d/1xL1foUsHgcHdVTOAMSJIST04cH0ukHd-oCKFw3m9sxY has our current thoughts, we've already done some of that such as sharding the cache invalidation stream.

@djschilling
Copy link

What i ment was the documentation of what is currently possible with Now that Synapse supports writing events from a different process

@erikjohnston
Copy link
Member Author

Ah, right. There isn't any yet, but we're aiming to get some docs for the next release. Right now its quite experimental and hasn't been tested a huge amount, so we don't recommend anyone try it out on production quite yet (unless they really really know what they're doing)

@benlangfeld
Copy link

Ah, right. There isn't any yet, but we're aiming to get some docs for the next release. Right now its quite experimental and hasn't been tested a huge amount, so we don't recommend anyone try it out on production quite yet (unless they really really know what they're doing)

Hey @erikjohnston. Did that documentation ever get written?

@erikjohnston
Copy link
Member Author

Ah, right. There isn't any yet, but we're aiming to get some docs for the next release. Right now its quite experimental and hasn't been tested a huge amount, so we don't recommend anyone try it out on production quite yet (unless they really really know what they're doing)

Hey @erikjohnston. Did that documentation ever get written?

Yup, how to move event persistence off master is now at: https://github.com/matrix-org/synapse/blob/develop/docs/workers.md#stream-writers

@benlangfeld
Copy link

Ah, right. There isn't any yet, but we're aiming to get some docs for the next release. Right now its quite experimental and hasn't been tested a huge amount, so we don't recommend anyone try it out on production quite yet (unless they really really know what they're doing)

Hey @erikjohnston. Did that documentation ever get written?

Yup, how to move event persistence off master is now at: https://github.com/matrix-org/synapse/blob/develop/docs/workers.md#stream-writers

Does that mean that this issue is complete? If not, what remains to be done?

Is there any documentation which clarifies why the master process still exists, and why it must be a singleton?

@benlangfeld
Copy link

Hey @erikjohnston , I wonder if maybe having skipped mentioning you meant you didn't see that question. I appreciate your time in helping understand this. We're evaluating Synapse for a use case that might justify our contributing or funding the contribution of improvements to HA.

@erikjohnston
Copy link
Member Author

I'm afraid there isn't an authoritative list of what still remains on master, broadly we've been moving stuff of master whenever we start seeing it become a problem, but that does mean there are quite a few APIs and streams that remain on master simply because they're not high intensity.

The way to figure out what is still on master is:

  1. Look at the servlets only loaded on master
  2. Look at replication streams on started on master
  3. Look at the places in the code where we check if we're on master, usually: worker_app is None:.

@erikjohnston erikjohnston added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Jun 11, 2021
@richvdh richvdh added A-Workers Problems related to running Synapse in Worker Mode (or replication) and removed z-operation gemini labels Feb 16, 2022
@richvdh
Copy link
Member

richvdh commented Feb 16, 2022

I'm going to close this, because the initial work is done. Remaining work includes:

@richvdh richvdh closed this as completed Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing A-Workers Problems related to running Synapse in Worker Mode (or replication) T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

4 participants