0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-16 06:51:46 +01:00

Add example on how to load balance /sync requests (#14297)

Signed-off-by: lukas <lukas.walter@aceart.de>

Signed-off-by: lukas <lukas.walter@aceart.de>
This commit is contained in:
aceArt-GmbH 2022-11-07 14:51:53 +01:00 committed by GitHub
parent e980982b59
commit 42f9d414c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

1
changelog.d/14297.doc Normal file
View file

@ -0,0 +1 @@
Add example on how to load balance /sync requests. Contributed by [aceArt](https://aceart.de).

View file

@ -305,9 +305,11 @@ may wish to run multiple groups of workers handling different endpoints so that
load balancing can be done in different ways. load balancing can be done in different ways.
For `/sync` and `/initialSync` requests it will be more efficient if all For `/sync` and `/initialSync` requests it will be more efficient if all
requests from a particular user are routed to a single instance. Extracting a requests from a particular user are routed to a single instance. This can
user ID from the access token or `Authorization` header is currently left as an be done e.g. in nginx via IP `hash $http_x_forwarded_for;` or via
exercise for the reader. Admins may additionally wish to separate out `/sync` `hash $http_authorization consistent;` which contains the users access token.
Admins may additionally wish to separate out `/sync`
requests that have a `since` query parameter from those that don't (and requests that have a `since` query parameter from those that don't (and
`/initialSync`), as requests that don't are known as "initial sync" that happens `/initialSync`), as requests that don't are known as "initial sync" that happens
when a user logs in on a new device and can be *very* resource intensive, so when a user logs in on a new device and can be *very* resource intensive, so