diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2022-01-13 14:35:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 14:35:52 +0000 |
commit | 20c6d85c6e8f721b8688b7f1361c7a7bab2449fd (patch) | |
tree | 2f931ca23048ce86f68fbbde9cef51dcf5048d08 /synapse/app | |
parent | Use auto_attribs/native type hints for attrs classes. (#11692) (diff) | |
download | synapse-20c6d85c6e8f721b8688b7f1361c7a7bab2449fd.tar.xz |
Simplify GC prometheus metrics (#11723)
Rather than hooking into the reactor loop, just add a timed task that runs every 100 ms to do the garbage collection. Part 1 of a quest to simplify the reactor monkey-patching.
Diffstat (limited to 'synapse/app')
-rw-r--r-- | synapse/app/_base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 5fc59c1be1..579adbbca0 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -60,7 +60,7 @@ from synapse.events.spamcheck import load_legacy_spam_checkers from synapse.events.third_party_rules import load_legacy_third_party_event_rules from synapse.handlers.auth import load_legacy_password_auth_providers from synapse.logging.context import PreserveLoggingContext -from synapse.metrics import register_threadpool +from synapse.metrics import install_gc_manager, register_threadpool from synapse.metrics.background_process_metrics import wrap_as_background_process from synapse.metrics.jemalloc import setup_jemalloc_stats from synapse.types import ISynapseReactor @@ -159,6 +159,7 @@ def start_reactor( change_resource_limit(soft_file_limit) if gc_thresholds: gc.set_threshold(*gc_thresholds) + install_gc_manager() run_command() # make sure that we run the reactor with the sentinel log context, |