Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

make it possible to change event_cache_size with a SIGHUP #13681

Open
richvdh opened this issue Aug 31, 2022 · 1 comment
Open

make it possible to change event_cache_size with a SIGHUP #13681

richvdh opened this issue Aug 31, 2022 · 1 comment
Labels
A-Config Configuration, or the documentation thereof O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented Aug 31, 2022

Most cache settings can be reloaded by sending Synapse a SIGHUP. Apparently not so event_cache_size. (Why does that even have a separate setting, rather than just being an entry under per_cache_factors ?)

@squahtx squahtx added A-Config Configuration, or the documentation thereof S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Sep 1, 2022
@DMRobertson
Copy link
Contributor

Apparently not so event_cache_size

There are some clues in this docstring:

def reload_cache_config(config: HomeServerConfig) -> None:
"""Reload cache config from disk and immediately apply it.resize caches accordingly.
If the config is invalid, a `ConfigError` is logged and no changes are made.
Otherwise, this:
- replaces the `caches` section on the given `config` object,
- resizes all caches according to the new cache factors, and
Note that the following cache config keys are read, but not applied:
- event_cache_size: used to set a max_size and _original_max_size on
EventsWorkerStore._get_event_cache when it is created. We'd have to update
the _original_max_size (and maybe
- sync_response_cache_duration: would have to update the timeout_sec attribute on
HomeServer -> SyncHandler -> ResponseCache.
- track_memory_usage. This affects synapse.util.caches.TRACK_MEMORY_USAGE which
influences Synapse's self-reported metrics.
Also, the HTTPConnectionPool in SimpleHTTPClient sets its maxPersistentPerHost
parameter based on the global_factor. This won't be applied on a config reload.

But I think the docstring is wrong about track_memory_usage given the line

synapse.util.caches.TRACK_MEMORY_USAGE = config.caches.track_memory_usage

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Config Configuration, or the documentation thereof O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

3 participants