diff --git a/changelog.d/17566.misc b/changelog.d/17566.misc new file mode 100644 index 00000000000..7210753fa3a --- /dev/null +++ b/changelog.d/17566.misc @@ -0,0 +1 @@ +Speed up responding to media requests. \ No newline at end of file diff --git a/synapse/server.py b/synapse/server.py index 8b07bb39a01..d6c9cbdac06 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -124,6 +124,7 @@ ) from synapse.http.matrixfederationclient import MatrixFederationHttpClient from synapse.media.media_repository import MediaRepository +from synapse.metrics import register_threadpool from synapse.metrics.common_usage_metrics import CommonUsageMetricsManager from synapse.module_api import ModuleApi from synapse.module_api.callbacks import ModuleApiCallbacks @@ -959,4 +960,7 @@ def get_media_sender_thread_pool(self) -> ThreadPool: "during", "shutdown", media_threadpool.stop ) + # Register the threadpool with our metrics. + register_threadpool("media", media_threadpool) + return media_threadpool