mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-10 18:26:23 -05:00
Allow background tasks to be run on a separate worker. (#8369)
This commit is contained in:
parent
462e681c79
commit
62894673e6
19 changed files with 537 additions and 449 deletions
|
|
@ -2504,6 +2504,11 @@ opentracing:
|
|||
# events: worker1
|
||||
# typing: worker1
|
||||
|
||||
# The worker that is used to run background tasks (e.g. cleaning up expired
|
||||
# data). If not provided this defaults to the main process.
|
||||
#
|
||||
#run_background_tasks_on: worker1
|
||||
|
||||
|
||||
# Configuration for Redis when using workers. This *must* be enabled when
|
||||
# using workers (unless using old style direct TCP configuration).
|
||||
|
|
|
|||
|
|
@ -319,6 +319,23 @@ stream_writers:
|
|||
events: event_persister1
|
||||
```
|
||||
|
||||
#### Background tasks
|
||||
|
||||
There is also *experimental* support for moving background tasks to a separate
|
||||
worker. Background tasks are run periodically or started via replication. Exactly
|
||||
which tasks are configured to run depends on your Synapse configuration (e.g. if
|
||||
stats is enabled).
|
||||
|
||||
To enable this, the worker must have a `worker_name` and can be configured to run
|
||||
background tasks. For example, to move background tasks to a dedicated worker,
|
||||
the shared configuration would include:
|
||||
|
||||
```yaml
|
||||
run_background_tasks_on: background_worker
|
||||
```
|
||||
|
||||
You might also wish to investigate the `update_user_directory` and
|
||||
`media_instance_running_background_jobs` settings.
|
||||
|
||||
### `synapse.app.pusher`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue