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

Update worker docs with recent enhancements #7969

Merged
merged 26 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2278562
Update worker documentation with latest additions
erikjohnston Jul 28, 2020
a880415
Add some of the new worker options to sample config
erikjohnston Jul 28, 2020
43df3fd
Newsfile
erikjohnston Jul 28, 2020
48ba564
Update docs/workers.md
erikjohnston Jul 28, 2020
5494d0c
Update synapse/config/redis.py
erikjohnston Jul 28, 2020
3e6af96
Update synapse/config/redis.py
erikjohnston Jul 28, 2020
8bd0b08
Update synapse/config/workers.py
erikjohnston Jul 28, 2020
b91e4fb
Update docs/workers.md
erikjohnston Jul 28, 2020
3dd4b73
Apply suggestions from code review
erikjohnston Jul 28, 2020
1fe0335
s/master/main/
erikjohnston Jul 28, 2020
dad0be0
Add back some notes about redis dependencies
erikjohnston Jul 28, 2020
31191fa
Clarify the 'federation_sender_instances' config
erikjohnston Jul 28, 2020
5d8a970
sample config
erikjohnston Jul 28, 2020
196e585
Review suggestions
erikjohnston Jul 29, 2020
21ef5cd
Add notes about installing Redis
erikjohnston Jul 29, 2020
8741ac7
Move fedearation shard config to worker config
erikjohnston Jul 29, 2020
c375b15
Note that redis must be enabled when using workers
erikjohnston Jul 29, 2020
63263ef
Fix sample config
erikjohnston Jul 29, 2020
6c78895
Apply suggestions from code review
erikjohnston Jul 29, 2020
9d891f8
Move config file explanation up
erikjohnston Jul 29, 2020
af26701
Move note about historical apps down
erikjohnston Jul 29, 2020
a236824
Doc worker_listeners
erikjohnston Jul 29, 2020
753c4f3
Specify what the room ID is in the path
erikjohnston Jul 29, 2020
308b181
Mention explicitly which streams can be moved off master
erikjohnston Jul 29, 2020
09aebbc
Move synctl worker config to seperate file
erikjohnston Jul 29, 2020
49e804b
Add architectural diagram
erikjohnston Jul 29, 2020
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/7969.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update worker docs with latest enhancements.
54 changes: 54 additions & 0 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2398,3 +2398,57 @@ opentracing:
#
# logging:
# false


## Workers ##

# Disables sending of outbound federation transactions on the main process.
# Uncomment if using a federation sender worker.
#
#send_federation: false

# It is possible to run multiple federation sender workers, in which case the
# work is balanced across them.
#
# This configuration must be shared between all federation sender workers, and if
# changed all federation sender workers must be stopped at the same time and then
# started, to ensure that all instances are running with the same config (otherwise
# events may be dropped).
#
#federation_sender_instances:
# - federation_sender1

# When using workers this should be a map from `worker_name` to the
# HTTP replication listener of the worker, if configured.
#
#instance_map:
# worker1:
# host: localhost
# port: 8034

# Experimental: When using workers you can define which workers should
# handle event persistence and typing notifications. Any worker
# specified here must also be in the `instance_map`.
#
#stream_writers:
# events: worker1
# typing: worker1


# Configuration for Redis when using workers. This *must* be enabled when
# using workers (unless using old style direct TCP configuration).
#
redis:
# Uncomment the below to enable Redis support.
#
#enabled: true

# Optional host and port to use to connect to redis. Defaults to
# localhost and 6379
#
#host: localhost
#port: 6379

# Optional password if configured on the Redis instance
#
#password: <secret_password>
32 changes: 32 additions & 0 deletions docs/synctl_workers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### Using synctl with workers

If you want to use `synctl` to manage your synapse processes, you will need to
create an an additional configuration file for the main synapse process. That
configuration should look like this:

```yaml
worker_app: synapse.app.homeserver
```

Additionally, each worker app must be configured with the name of a "pid file",
to which it will write its process ID when it starts. For example, for a
synchrotron, you might write:

```yaml
worker_pid_file: /home/matrix/synapse/worker1.pid
```

Finally, to actually run your worker-based synapse, you must pass synctl the `-a`
commandline option to tell it to operate on all the worker configurations found
in the given directory, e.g.:

synctl -a $CONFIG/workers start

Currently one should always restart all workers when restarting or upgrading
synapse, unless you explicitly know it's safe not to. For instance, restarting
synapse without restarting all the synchrotrons may result in broken typing
notifications.

To manipulate a specific worker, you pass the -w option to synctl:

synctl -w $CONFIG/workers/worker1.yaml restart
Loading