feat(synapse): allow using multiple federation workers

This commit is contained in:
transcaffeine 2022-04-15 15:43:56 +02:00
parent f5a6e12538
commit adaf4acb1f
Signed by: transcaffeine
GPG Key ID: 03624C433676E465
3 changed files with 12 additions and 5 deletions

View File

@ -19,7 +19,7 @@
worker:
type: 'federation_sender'
instanceId: "{{ item }}"
port: 0
port: "{{ item }}"
metrics_port: "{{ matrix_synapse_workers_federation_sender_workers_metrics_range_start + item }}"
register: "matrix_synapse_workers_list_results_federation_sender_workers"
loop: "{{ range(0, matrix_synapse_workers_federation_sender_workers_count|int)|list }}"

View File

@ -20,7 +20,7 @@
with_items:
- "matrix_synapse_workers_appservice_workers_count"
- "matrix_synapse_workers_pusher_workers_count"
- "matrix_synapse_workers_federation_sender_workers_count"
# - "matrix_synapse_workers_federation_sender_workers_count"
- name: (Deprecation) Catch and report renamed settings
fail:

View File

@ -2848,7 +2848,9 @@ opentracing:
# Disables sending of outbound federation transactions on the main process.
# Uncomment if using a federation sender worker.
#
#send_federation: false
{% if matrix_synapse_workers_federation_sender_workers_count|int > 0 %}
send_federation: false
{% endif %}
# It is possible to run multiple federation sender workers, in which case the
# work is balanced across them.
@ -2858,8 +2860,13 @@ opentracing:
# started, to ensure that all instances are running with the same config (otherwise
# events may be dropped).
#
#federation_sender_instances:
# - federation_sender1
{% if matrix_synapse_workers_federation_sender_workers_count != 0%}
federation_sender_instances:
{% for i in range(0, matrix_synapse_workers_federation_sender_workers_count|int)|list %}
# -dd federation_sender1
- federation_sender:{{ i | int }}
{% endfor %}
{% endif %}
# When using workers this should be a map from `worker_name` to the
# HTTP replication listener of the worker, if configured.