Explorar el Código

Make Synapse cache factor configurable

pull/13/head
Slavi Pantaleev hace 7 años
padre
commit
242f388af3
Se han modificado 5 ficheros con 27 adiciones y 1 borrados
  1. +10
    -0
      CHANGELOG.md
  2. +7
    -0
      roles/matrix-server/defaults/main.yml
  3. +7
    -0
      roles/matrix-server/tasks/setup_synapse_main.yml
  4. +2
    -0
      roles/matrix-server/templates/env/env-synapse.j2
  5. +1
    -1
      roles/matrix-server/templates/systemd/matrix-synapse.service.j2

+ 10
- 0
CHANGELOG.md Ver fichero

@@ -1,3 +1,13 @@
# 2018-09-27

## Synapse Cache Factor made configurable

The playbook now makes the Synapse cache factor configurable, through the playbook's `matrix_synapse_cache_factor` variable (having a default value of `0.5`).

Changing that value allows you to potentially decrease RAM usage or to increase performance by caching more stuff.
Some information on it is available here: https://github.com/matrix-org/synapse#help-synapse-eats-all-my-ram


# 2018-09-26

## Disabling Docker container logging


+ 7
- 0
roles/matrix-server/defaults/main.yml Ver fichero

@@ -74,6 +74,13 @@ matrix_synapse_password_config_pepper: ""
# Controls the number of events that Matrix Synapse caches in memory.
matrix_synapse_event_cache_size: "100K"

# Controls cache sizes for Matrix Synapse via the SYNAPSE_CACHE_FACTOR environment variable.
# Raise this to increase cache sizes or lower it to potentially lower memory use.
# To learn more, see:
# - https://github.com/matrix-org/synapse#help-synapse-eats-all-my-ram
# - https://github.com/matrix-org/synapse/issues/3939
matrix_synapse_cache_factor: 0.5

# A list of additional "volumes" to mount in the container.
# This list gets populated dynamically based on Synapse extensions that have been enabled.
# Contains definition objects like this: `{"src": "/outside", "dst": "/inside", "options": "rw|ro|slave|.."}


+ 7
- 0
roles/matrix-server/tasks/setup_synapse_main.yml Ver fichero

@@ -61,6 +61,13 @@
dest: "{{ matrix_synapse_config_dir_path }}/{{ hostname_matrix }}.log.config"
mode: 0644

- name: Ensure Synapse environment variables file created
template:
src: "{{ role_path }}/templates/env/env-synapse.j2"
dest: "{{ matrix_environment_variables_data_path }}/synapse"
owner: root
mode: 0600

- name: Ensure matrix-synapse.service installed
template:
src: "{{ role_path }}/templates/systemd/matrix-synapse.service.j2"


+ 2
- 0
roles/matrix-server/templates/env/env-synapse.j2 Ver fichero

@@ -0,0 +1,2 @@
SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
SYNAPSE_CACHE_FACTOR={{ matrix_synapse_cache_factor }}

+ 1
- 1
roles/matrix-server/templates/systemd/matrix-synapse.service.j2 Ver fichero

@@ -27,6 +27,7 @@ ExecStartPre=/bin/sleep 5
{% endif %}
ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
--log-driver=none \
--env-file={{ matrix_environment_variables_data_path }}/synapse \
--network={{ matrix_docker_network }} \
-p 8448:8448 \
{% if not matrix_nginx_proxy_enabled %}
@@ -38,7 +39,6 @@ ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
{% for volume in matrix_synapse_container_additional_volumes %}
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
{% endfor %}
-e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml \
{{ matrix_docker_image_synapse }}
ExecStop=-/usr/bin/docker kill matrix-synapse
ExecStop=-/usr/bin/docker rm matrix-synapse


Cargando…
Cancelar
Guardar