Просмотр исходного кода

Randomize `matrix-synapse-auto-compressor.timer` start with a `RandomizedDelaySec` (defaults to 6h)

pull/4221/head
Slavi Pantaleev 11 месяцев назад
Родитель
Сommit
e8c9a0e410
3 измененных файлов: 11 добавлений и 2 удалений
  1. +4
    -1
      docs/configuring-playbook-synapse-auto-compressor.md
  2. +6
    -1
      roles/custom/matrix-synapse-auto-compressor/defaults/main.yml
  3. +1
    -0
      roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.timer.j2

+ 4
- 1
docs/configuring-playbook-synapse-auto-compressor.md Просмотреть файл

@@ -24,12 +24,15 @@ matrix_synapse_auto_compressor_enabled: true


### Edit the schedule (optional) ### Edit the schedule (optional)


By default the task will run 0 a.m. every day based on the `matrix_synapse_auto_compressor_schedule` variable. It is defined in the format of systemd timer calendar.
By default the task will around 0 a.m. every day based on the `matrix_synapse_auto_compressor_schedule` variable with a randomized delay of 6 hours (controlled by the `matrix_synapse_auto_compressor_schedule_randomized_delay_sec` variable). It is defined in the format of systemd timer calendar.


To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs): To edit the schedule, add the following configuration to your `vars.yml` file (adapt to your needs):


```yaml ```yaml
matrix_synapse_auto_compressor_schedule: "*-*-* 00:00:00" matrix_synapse_auto_compressor_schedule: "*-*-* 00:00:00"

# Consider adjusting the randomized delay or setting it to 0 to disable randomized delays.
# matrix_synapse_auto_compressor_schedule_randomized_delay_sec: 6h
``` ```


### Extending the configuration ### Extending the configuration


+ 6
- 1
roles/custom/matrix-synapse-auto-compressor/defaults/main.yml Просмотреть файл

@@ -64,9 +64,14 @@ matrix_synapse_auto_compressor_database_name: 'synapse'
# connection string to synapse database (postgres only) # connection string to synapse database (postgres only)
matrix_synapse_auto_compressor_synapse_database: 'postgres://{{ matrix_synapse_auto_compressor_database_username | urlencode() }}:{{ matrix_synapse_auto_compressor_database_password | urlencode() }}@{{ matrix_synapse_auto_compressor_database_hostname }}:{{ matrix_synapse_auto_compressor_database_port }}/{{ matrix_synapse_auto_compressor_database_name }}' matrix_synapse_auto_compressor_synapse_database: 'postgres://{{ matrix_synapse_auto_compressor_database_username | urlencode() }}:{{ matrix_synapse_auto_compressor_database_password | urlencode() }}@{{ matrix_synapse_auto_compressor_database_hostname }}:{{ matrix_synapse_auto_compressor_database_port }}/{{ matrix_synapse_auto_compressor_database_name }}'


# systemd calendar configuration for the compressor job
# Controls the `OnCalendar` configuration for the compressor job.
# Also see: `matrix_synapse_auto_compressor_schedule_randomized_delay_sec`
matrix_synapse_auto_compressor_schedule: "*-*-* 00:00:00" matrix_synapse_auto_compressor_schedule: "*-*-* 00:00:00"


# The `RandomizedDelaySec` delay (in seconds or as a systemd time string) to randomize the `OnCalendar` start time (`matrix_synapse_auto_compressor_schedule`) of the compressor job.
# This can be set to 0 to disable randomized delays.
matrix_synapse_auto_compressor_schedule_randomized_delay_sec: 6h

# The number of state groups to work on at once. # The number of state groups to work on at once.
# All of the entries from state_groups_state are requested from the database for state groups that are worked on. # All of the entries from state_groups_state are requested from the database for state groups that are worked on.
# Therefore small chunk sizes may be needed on machines with low memory. # Therefore small chunk sizes may be needed on machines with low memory.


+ 1
- 0
roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.timer.j2 Просмотреть файл

@@ -11,6 +11,7 @@ Description=Synapse State Auto Compressor Timer
[Timer] [Timer]
Unit=matrix-synapse-auto-compressor.service Unit=matrix-synapse-auto-compressor.service
OnCalendar={{ matrix_synapse_auto_compressor_schedule }} OnCalendar={{ matrix_synapse_auto_compressor_schedule }}
RandomizedDelaySec={{ matrix_synapse_auto_compressor_schedule_randomized_delay_sec }}


[Install] [Install]
WantedBy=timers.target WantedBy=timers.target

Загрузка…
Отмена
Сохранить