Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

synapse:
workers:
account-data:
enabled: true
appservice:
enabled: true
background:
Expand Down Expand Up @@ -34,7 +36,7 @@ synapse:
pusher:
enabled: true
replicas: 2
receipts-account:
receipts:
enabled: true
sliding-sync:
enabled: true
Expand Down
4 changes: 3 additions & 1 deletion charts/matrix-stack/ci/synapse-worker-example-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ synapse:
ingress:
host: synapse.ess.localhost
workers:
account-data:
enabled: true
appservice:
enabled: true
background:
Expand Down Expand Up @@ -49,7 +51,7 @@ synapse:
pusher:
enabled: true
replicas: 2
receipts-account:
receipts:
enabled: true
sliding-sync:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ workers instead if these requests path are under high load.
# push-rules
^/\_matrix/client/(api/v1|r0|v3|unstable)/pushrules/

# receipts-account
# account-data
^/\_matrix/client/(r0|v3|unstable)/._/tags
^/\_matrix/client/(r0|v3|unstable)/._/account\_data

Expand Down
7 changes: 5 additions & 2 deletions charts/matrix-stack/source/synapse.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
"workers": {
"type": "object",
"properties": {
"account-data": {
"$ref": "file://synapse/single_worker.json"
},
"appservice": {
"$ref": "file://synapse/single_worker.json"
},
Expand Down Expand Up @@ -226,8 +229,8 @@
"pusher": {
"$ref": "file://synapse/scalable_worker.json"
},
"receipts-account": {
"$ref": "file://synapse/single_worker.json"
"receipts": {
"$ref": "file://synapse/scalable_worker.json"
},
"sliding-sync": {
"$ref": "file://synapse/scalable_worker.json"
Expand Down
3 changes: 2 additions & 1 deletion charts/matrix-stack/source/synapse.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ appservices: []
## event-creator:
## enabled: true
workers:
{{- synapse_sub_schema_values.single_worker('account-data') | indent(2) }}
{{- synapse_sub_schema_values.single_worker('appservice') | indent(2) }}
{{- synapse_sub_schema_values.single_worker('background') | indent(2) }}
{{- synapse_sub_schema_values.scalable_worker('client-reader') | indent(2) }}
Expand All @@ -65,7 +66,7 @@ workers:
{{- synapse_sub_schema_values.single_worker('presence-writer') | indent(2) }}
{{- synapse_sub_schema_values.single_worker('push-rules') | indent(2) }}
{{- synapse_sub_schema_values.scalable_worker('pusher') | indent(2) }}
{{- synapse_sub_schema_values.single_worker('receipts-account') | indent(2) }}
{{- synapse_sub_schema_values.scalable_worker('receipts') | indent(2) }}
{{- synapse_sub_schema_values.scalable_worker('sliding-sync') | indent(2) }}
{{- synapse_sub_schema_values.single_worker('sso-login') | indent(2) }}
{{- synapse_sub_schema_values.scalable_worker('synchrotron') | indent(2) }}
Expand Down
30 changes: 19 additions & 11 deletions charts/matrix-stack/templates/synapse/_synapse_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{- $root := .root -}}
{{- with required "element-io.synapse.process.hasHttp missing context" .context -}}
{{ $hasHttp := (list "main"
"account-data"
"client-reader"
"encryption"
"event-creator"
Expand All @@ -17,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
"media-repository"
"presence-writer"
"push-rules"
"receipts-account"
"receipts"
"sliding-sync"
"sso-login"
"synchrotron"
Expand All @@ -33,11 +34,12 @@ hasHttp
{{- $root := .root -}}
{{- with required "element-io.synapse.process.hasReplication missing context" .context -}}
{{- $hasReplication := (list "main"
"account-data"
"encryption"
"event-persister"
"push-rules"
"presence-writer"
"receipts-account"
"receipts"
"typing-persister") }}
{{- if has . $hasReplication -}}
hasReplication
Expand All @@ -49,13 +51,14 @@ hasReplication
{{- $root := .root -}}
{{- with required "element-io.synapse.process.isSingle missing context" .context -}}
{{ $isSingle := (list "main"
"account-data"
"appservice"
"background"
"encryption"
"media-repository"
"presence-writer"
"push-rules"
"receipts-account"
"receipts"
"sso-login"
"typing-persister"
"user-dir") }}
Expand Down Expand Up @@ -92,8 +95,6 @@ initial-sync
media-repo
{{- else if eq . "presence-writer" -}}
presence-write
{{- else if eq . "receipts-account" -}}
receipts-accnt
{{- else if eq . "typing-persister" -}}
typing
{{- else -}}
Expand Down Expand Up @@ -131,16 +132,18 @@ responsibleForMedia
{{- define "element-io.synapse.process.streamWriters" -}}
{{- $root := .root -}}
{{- with required "element-io.synapse.process.streamWriters missing context" .context -}}
{{- if eq . "encryption" }}
{{- if eq . "account-data" }}
{{ list "account_data" | toJson }}
{{- else if eq . "encryption" }}
{{ list "to_device" | toJson }}
{{- else if eq . "event-persister" }}
{{ list "events" | toJson }}
{{- else if eq . "presence-writer" }}
{{ list "presence" | toJson }}
{{- else if eq . "push-rules" }}
{{ list "push_rules" | toJson }}
{{- else if eq . "receipts-account" }}
{{ list "account_data" "receipts" | toJson }}
{{- else if eq . "receipts" }}
{{ list "receipts" | toJson }}
{{- else if eq . "typing-persister" }}
{{ list "typing" | toJson }}
{{- else -}}
Expand Down Expand Up @@ -225,6 +228,13 @@ responsibleForMedia
{{- with required "element-io.synapse.process.workerPaths missing context" .context -}}
{{ $workerPaths := list }}

{{- if eq .workerType "account-data" }}
{{ $workerPaths = concat $workerPaths (list
"^/_matrix/client/(r0|v3|unstable)/.*/tags"
"^/_matrix/client/(r0|v3|unstable)/.*/account_data"
) }}
{{- end }}

{{- if eq .workerType "client-reader" }}
{{- /* Client API requests (apart from createRoom which is eventCreator) */}}
{{ $workerPaths = concat $workerPaths (list
Expand Down Expand Up @@ -374,10 +384,8 @@ responsibleForMedia
) }}
{{- end }}

{{- if eq .workerType "receipts-account" }}
{{- if eq .workerType "receipts" }}
{{ $workerPaths = concat $workerPaths (list
"^/_matrix/client/(r0|v3|unstable)/.*/tags"
"^/_matrix/client/(r0|v3|unstable)/.*/account_data"
"^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt"
"^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers"
) }}
Expand Down
Loading
Loading