matrix-docker-ansible-deploy/roles/custom/matrix-synapse/defaults
Slavi Pantaleev d0cda27c97 Fix Synapse cache auto-tuning variables to use bytes, not KB
Fixup for https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3017

This reverts 1cd82cf068 and also multiplies results by `1024`
so as to pass bytes to Synapse, not KB (as done before).

1cd82cf068 was correctly documenting what we were doing (passing KB values),
but that's incorrect.

Synapse's Config Conventions
(https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#config-conventions)
are supposed to clear it up, but they don't currently state what happens when you pass a plain number (without a unit suffix).

Thankfully, the source code tells us:
bc1db16086/synapse/config/_base.py (L181-L206)

> If an integer is provided it is treated as bytes and is unchanged.
>
> String byte sizes can have a suffix of ...
> No suffix is understood as a plain byte count.

We were previously passing strings, but that has been improved in 3d73ec887a.

Regardless, non-suffixed values seem to be treated as bytes by Synapse,
so this patch changes the variables to use bytes.

Moreover, we're moving from `matrix_synapse_memtotal_kb` to
`matrix_synapse_cache_size_calculations_memtotal_bytes` as working with
the base unit everywhere is preferrable.

Here, we also introduce 2 new variables to allow for the caps to be
tweaked:

- `matrix_synapse_cache_size_calculations_max_cache_memory_usage_cap_bytes`
- `matrix_synapse_cache_size_calculations_target_cache_memory_usage_cap_bytes`
2024-02-14 13:39:40 +02:00
..
main.yml Fix Synapse cache auto-tuning variables to use bytes, not KB 2024-02-14 13:39:40 +02:00