Bläddra i källkod

Rename variables for consistency (matrix_synapse_caches_autotuning_* -> matrix_synapse_cache_autotuning_*)

pull/3017/head
Slavi Pantaleev 2 år sedan
förälder
incheckning
660ba1ae8f
4 ändrade filer med 13 tillägg och 10 borttagningar
  1. +4
    -4
      docs/maintenance-synapse.md
  2. +3
    -3
      roles/custom/matrix-synapse/defaults/main.yml
  3. +3
    -0
      roles/custom/matrix-synapse/tasks/validate_config.yml
  4. +3
    -3
      roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2

+ 4
- 4
docs/maintenance-synapse.md Visa fil

@@ -82,12 +82,12 @@ Tuning Synapse's cache factor is useful for performance increases but also as pa

Tuning the cache factor is useful only to a limited degree as its crude to do in isolation and therefore users who are tuning their cache factor should likely look into tuning the autotune variables also.

Cache autotune is controlled primarily via the following variables `matrix_synapse_caches_autotuning_max_cache_memory_usage: ""` `matrix_synapse_caches_autotuning_target_cache_memory_usage: ""` `matrix_synapse_caches_autotuning_min_cache_ttl: ""`
Cache autotune is controlled primarily via the following variables `matrix_synapse_cache_autotuning_max_cache_memory_usage: ""` `matrix_synapse_cache_autotuning_target_cache_memory_usage: ""` `matrix_synapse_cache_autotuning_min_cache_ttl: ""`

The `matrix_synapse_caches_autotuning_max_cache_memory_usage: ""` variable controls the maximum amount of ram Synapse is allowed to use before synapse aggressively tries to get rid of cache until you either hit `matrix_synapse_caches_autotuning_min_cache_ttl: ""` being the age of your cache or you hit your memory use target set by `matrix_synapse_caches_autotuning_target_cache_memory_usage: ""`
The `matrix_synapse_cache_autotuning_max_cache_memory_usage: ""` variable controls the maximum amount of ram Synapse is allowed to use before synapse aggressively tries to get rid of cache until you either hit `matrix_synapse_cache_autotuning_min_cache_ttl: ""` being the age of your cache or you hit your memory use target set by `matrix_synapse_cache_autotuning_target_cache_memory_usage: ""`

The playbook defaults these settings to `1/8 of system ram up to 2048mb` for max use and `1/16 of system ram up to 1024MB` as target and `30s` as the minimum age of cache entries that are allowed to be evicted by autotune.
The playbook defaults these settings to `1/8 of system ram up to 2048mb` for max use and `1/16 of system ram up to 1024MB` as target and `30s` as the minimum age of cache entries that are allowed to be evicted by autotune.

Users who wish to lower Synapses RAM footprint should look at lowering cache factor together with autotune variables. If your cache factor is too low for a given auto tune setting your caches will not reach auto tune thresholds and therefore autotune wont be doing its job. Therefore its recommended to when running auto tune have your cache factor be too big by a resonable margin instead as to be able to have full use of autotune.
Users who wish to lower Synapses RAM footprint should look at lowering cache factor together with autotune variables. If your cache factor is too low for a given auto tune setting your caches will not reach auto tune thresholds and therefore autotune wont be doing its job. Therefore its recommended to when running auto tune have your cache factor be too big by a resonable margin instead as to be able to have full use of autotune.

See also [How do I optimize this setup for a low-power server?](faq.md#how-do-i-optimize-this-setup-for-a-low-power-server).

+ 3
- 3
roles/custom/matrix-synapse/defaults/main.yml Visa fil

@@ -556,13 +556,13 @@ matrix_synapse_caches_global_factor: 10
matrix_synapse_caches_expire_caches: true
matrix_synapse_caches_cache_entry_ttl: "1080m"
matrix_synapse_caches_sync_response_cache_duration: "2m"
matrix_synapse_caches_autotuning_min_cache_ttl: "30s"
matrix_synapse_cache_autotuning_min_cache_ttl: "30s"
# The Cache tune math used here is a derivative of the same math used to autotune sizes for postgres.
# The memtotal variable can in theory be overiden to make Synapse think it has less ram to work with.
# But if your at the point of considering that just override the math or put static values in.
matrix_synapse_memtotal_kb: "{{ ansible_memtotal_mb*1024|int }}"
matrix_synapse_caches_autotuning_max_cache_memory_usage: "{{ 2097152 if (matrix_synapse_memtotal_kb|int/8)/1024 >= 2048 else matrix_synapse_memtotal_kb|int/8 }}"
matrix_synapse_caches_autotuning_target_cache_memory_usage: "{{ 1048576 if (matrix_synapse_memtotal_kb|int/16)/1024 >= 1024 else matrix_synapse_memtotal_kb|int/16 }}"
matrix_synapse_cache_autotuning_max_cache_memory_usage: "{{ 2097152 if (matrix_synapse_memtotal_kb|int/8)/1024 >= 2048 else matrix_synapse_memtotal_kb|int/8 }}"
matrix_synapse_cache_autotuning_target_cache_memory_usage: "{{ 1048576 if (matrix_synapse_memtotal_kb|int/16)/1024 >= 1024 else matrix_synapse_memtotal_kb|int/16 }}"

# Controls whether Synapse will federate at all.
# Disable this to completely isolate your server from the rest of the Matrix network.


+ 3
- 0
roles/custom/matrix-synapse/tasks/validate_config.yml Visa fil

@@ -84,6 +84,9 @@
- {'old': 'matrix_synapse_send_federation', 'new': '<unnecessary - Synapse relies on federation_sender_instances now>'}
- {'old': 'matrix_synapse_start_pushers', 'new': '<unnecessary - Synapse relies on pusher_instances now>'}
- {'old': 'matrix_synapse_spam_checker', 'new': '<superseded by matrix_synapse_modules>'}
- {'old': 'matrix_synapse_caches_autotuning_max_cache_memory_usage', 'new': 'matrix_synapse_cache_autotuning_max_cache_memory_usage'}
- {'old': 'matrix_synapse_caches_autotuning_target_cache_memory_usage', 'new': 'matrix_synapse_cache_autotuning_target_cache_memory_usage'}
- {'old': 'matrix_synapse_caches_autotuning_min_cache_ttl', 'new': 'matrix_synapse_cache_autotuning_min_cache_ttl'}

- name: (Deprecation) Catch and report renamed settings in matrix_synapse_configuration_extension_yaml
ansible.builtin.fail:


+ 3
- 3
roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 Visa fil

@@ -817,9 +817,9 @@ caches:
# for information for now
#
cache_autotuning:
max_cache_memory_usage: {{ matrix_synapse_caches_autotuning_max_cache_memory_usage | to_json }}
target_cache_memory_usage: {{ matrix_synapse_caches_autotuning_target_cache_memory_usage | to_json }}
min_cache_ttl: {{ matrix_synapse_caches_autotuning_min_cache_ttl | to_json }}
max_cache_memory_usage: {{ matrix_synapse_cache_autotuning_max_cache_memory_usage | to_json }}
target_cache_memory_usage: {{ matrix_synapse_cache_autotuning_target_cache_memory_usage | to_json }}
min_cache_ttl: {{ matrix_synapse_cache_autotuning_min_cache_ttl | to_json }}


## Database ##


Laddar…
Avbryt
Spara