element-hq / element-hq/synapse
Full high-availability (Redis Cluster/Sentinel support)
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
**Description:**
Currently (as of v1.102.0) Synapse supports horizontal scaling capability via workers. As I understand, the current worker capabilities result in somewhat complete request processing independence from the main worker process (for which we cannot run multiple processes), so at first glance, Synapse is highly-available.
However, using workers require the use of Redis. Synapse (again, as of v1.102.0) only supports a single Redis hostname and port. It does not support Redis Sentinel, which would handle Redis master (write-capable) election and redirection.
I've found a PR in the old matrix-org repo for adding Redis Sentinel support, but I have no ability to maintain it - so adding an issue ticket here instead.
Additionally, I think it might be worthwhile to add relevant guidelines in the Synapse documentation for information on how to achieve a highly-available setup. The [2020 post about scaling Synapse](https://matrix.org/blog/2020/11/03/how-we-fixed-synapse-s-scalability/) seems to indicate multiple Redis instances in their diagrams, but I can't seem to figure out how to achieve this with Synapse, as supporting Redis Cluster requires the redis client to be cluster-aware.
Related issues:
- https://github.com/element-hq/synapse/issues/15478
- https://github.com/element-hq/synapse/issues/13126
- https://github.com/element-hq/synapse/issues/15122 (this is the PR mentioned below converted to an issue (?))
Related PRs:
- https://github.com/matrix-org/synapse/pull/15122
Contributor guide
Assessment
This issue has not been assessed yet.