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

Commit

Permalink
Update worker docs with recent enhancements (#7969)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Jul 29, 2020
1 parent 7000a21 commit 2c1b9d6
Show file tree
Hide file tree
Showing 14 changed files with 413 additions and 235 deletions.
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

0 comments on commit 2c1b9d6

Please sign in to comment.