summary refs log tree commit diff
path: root/synapse/app/homeserver.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-07 16:07:54 +0100
committerErik Johnston <erik@matrix.org>2016-06-07 16:07:54 +0100
commitb01e71e7193d6b879c1690fca4891a9855232bda (patch)
treee1b554e6654ea69490c750c66fbd9cf75be3d982 /synapse/app/homeserver.py
parentMerge pull request #848 from matrix-org/markjh/unusedIV (diff)
parentAllow setting of gc.set_thresholds (diff)
downloadsynapse-b01e71e7193d6b879c1690fca4891a9855232bda.tar.xz
Merge pull request #849 from matrix-org/erikj/gc_threshold
Allow setting of gc.set_thresholds
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-xsynapse/app/homeserver.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index df675c0ed4..22e1721fc4 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -16,6 +16,7 @@
 
 import synapse
 
+import gc
 import logging
 import os
 import sys
@@ -351,6 +352,8 @@ class SynapseService(service.Service):
     def startService(self):
         hs = setup(self.config)
         change_resource_limit(hs.config.soft_file_limit)
+        if hs.config.gc_thresholds:
+            gc.set_threshold(*hs.config.gc_thresholds)
 
     def stopService(self):
         return self._port.stopListening()
@@ -422,6 +425,8 @@ def run(hs):
         # sys.settrace(logcontext_tracer)
         with LoggingContext("run"):
             change_resource_limit(hs.config.soft_file_limit)
+            if hs.config.gc_thresholds:
+                gc.set_threshold(*hs.config.gc_thresholds)
             reactor.run()
 
     if hs.config.daemonize: