Verified Commit 265c3b6b authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

matrix: Start splitting synapse into workers

Add appservice and federation_sender workers, which do not need any
NGINX configuration.
parent 14097eee
[Unit]
Description=Synapse Matrix worker (%i)
BindsTo=synapse.service
After=synapse.service
[Service]
Type=notify
NotifyAccess=main
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
User=synapse
WorkingDirectory=~
ExecStart=/var/lib/synapse/venv/bin/python -m synapse.app.%i --config-path=/etc/synapse/homeserver.yaml --config-path=/etc/synapse/worker-%i.yaml
SyslogIdentifier=synapse-worker-%i
Environment=SYNAPSE_CACHE_FACTOR=1.0
Environment=LD_PRELOAD=/usr/lib/libjemalloc.so
[Install]
RequiredBy=synapse.service
# vim:set ft=systemd:
worker_app: synapse.app.appservice
# vim:ft=yaml sw=2 et:
worker_app: synapse.app.federation_sender
# vim:ft=yaml sw=2 et:
......@@ -82,8 +82,12 @@
notify:
- restart synapse
- name: install log config
copy: src=log_config.yaml dest=/etc/synapse/log_config.yaml owner=root group=root mode=0644
- name: install static config
copy: src={{ item }} dest=/etc/synapse/{{ item }} owner=root group=root mode=0644
with_items:
- log_config.yaml
- worker-appservice.yaml
- worker-federation_sender.yaml
notify:
- restart synapse
......@@ -123,13 +127,35 @@
when: 'matrix_domain is defined'
tags: ['nginx']
- name: install matrix units
- name: install synapse units
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
with_items:
- synapse.service
- synapse-worker@.service
notify:
- restart synapse
- name: install matrix-appservice-irc units
copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
with_items:
- matrix-appservice-irc.service
notify:
- restart matrix-appservice-irc
- name: enable synapse units
service: name={{ item }} enabled=yes
with_items:
- synapse.service
- synapse-worker@appservice.service
- synapse-worker@federation_sender.service
notify:
- restart synapse
- name: enable matrix-appservice-irc units
service: name={{ item }} enabled=yes
with_items:
- matrix-appservice-irc.service
notify:
- restart matrix-appservice-irc
- name: open firewall holes
......
# vim:ft=yaml sw=2 et:
# Worker config
worker_app: synapse.app.homeserver
worker_log_config: "/etc/synapse/log_config.yaml"
worker_replication_host: 127.0.0.1
worker_replication_port: 9092
worker_replication_http_port: 9093
# Delegate to federation_sender worker
send_federation: false
# Delegate to appservice worker
notify_appservices: false
################################################################################
# Configuration file for Synapse.
......@@ -231,6 +244,17 @@ listeners:
# module: my_module.CustomRequestHandler
# config: {}
- port: 9092
type: replication
bind_addresses: ['::1', '127.0.0.1']
- port: 9093
type: http
bind_addresses: ['::1', '127.0.0.1']
resources:
- names: [replication]
compress: false
# Turn on the twisted ssh manhole service on localhost on the given
# port.
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment