summary refs log tree commit diff
path: root/synapse/app/pusher.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/pusher.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/pusher.py')
-rw-r--r--synapse/app/pusher.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py
index 3c3fa38053..7e2bf7ecc2 100644
--- a/synapse/app/pusher.py
+++ b/synapse/app/pusher.py
@@ -43,6 +43,7 @@ from twisted.web.resource import Resource
 
 from daemonize import Daemonize
 
+import gc
 import sys
 import logging
 
@@ -342,6 +343,8 @@ def setup(config_options):
     ps.start_listening()
 
     change_resource_limit(ps.config.soft_file_limit)
+    if ps.config.gc_thresholds:
+        gc.set_threshold(*ps.config.gc_thresholds)
 
     def start():
         ps.replicate()
@@ -361,6 +364,8 @@ if __name__ == '__main__':
             def run():
                 with LoggingContext("run"):
                     change_resource_limit(ps.config.soft_file_limit)
+                    if ps.config.gc_thresholds:
+                        gc.set_threshold(*ps.config.gc_thresholds)
                     reactor.run()
 
             daemon = Daemonize(