feat(synapse): allow using multiple federation workers

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

View File

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

View File

@ -20,7 +20,7 @@
with_items: with_items:
- "matrix_synapse_workers_appservice_workers_count" - "matrix_synapse_workers_appservice_workers_count"
- "matrix_synapse_workers_pusher_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 - name: (Deprecation) Catch and report renamed settings
fail: fail:

View File

@ -2859,7 +2859,9 @@ opentracing:
# Disables sending of outbound federation transactions on the main process. # Disables sending of outbound federation transactions on the main process.
# Uncomment if using a federation sender worker. # 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 # It is possible to run multiple federation sender workers, in which case the
# work is balanced across them. # work is balanced across them.
@ -2869,8 +2871,13 @@ opentracing:
# started, to ensure that all instances are running with the same config (otherwise # started, to ensure that all instances are running with the same config (otherwise
# events may be dropped). # events may be dropped).
# #
#federation_sender_instances: {% if matrix_synapse_workers_federation_sender_workers_count != 0%}
# - federation_sender1 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 # When using workers this should be a map from `worker_name` to the
# HTTP replication listener of the worker, if configured. # HTTP replication listener of the worker, if configured.