From 2d7e56186af8543ad6ff3b39e2c2851b01db1fbe Mon Sep 17 00:00:00 2001 From: miigotu Date: Thu, 25 Feb 2016 18:45:38 -0800 Subject: [PATCH] 50 Threads? Really? This fix halves VIRT alloc, to halve it again add export MALLOC_ARENA_MAX=2 (or 1) to your runscript on linux) --- sickbeard/webserve.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 16c552611c..8086c830e6 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -88,8 +88,12 @@ from tornado.web import RequestHandler, HTTPError, authenticated from tornado.gen import coroutine from tornado.ioloop import IOLoop -from tornado.concurrent import run_on_executor + from concurrent.futures import ThreadPoolExecutor +from tornado.process import cpu_count + +from tornado.concurrent import run_on_executor + from mako.runtime import UNDEFINED mako_lookup = None @@ -255,7 +259,7 @@ def __init__(self, *args, **kwargs): super(WebHandler, self).__init__(*args, **kwargs) self.io_loop = IOLoop.current() - executor = ThreadPoolExecutor(50) + executor = ThreadPoolExecutor(cpu_count()) @authenticated @coroutine