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

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

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14297.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add example on how to load balance /sync requests. Contributed by [aceArt](https://aceart.de).
8 changes: 5 additions & 3 deletions docs/workers.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,11 @@ may wish to run multiple groups of workers handling different endpoints so that
load balancing can be done in different ways.

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
user ID from the access token or `Authorization` header is currently left as an
exercise for the reader. Admins may additionally wish to separate out `/sync`
requests from a particular user are routed to a single instance. This can
be done e.g. in nginx via IP `hash $http_x_forwarded_for;` or via
`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
`/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
Expand Down