Skip to content

Commit

Permalink
50 Threads? Really? This fix halves VIRT alloc, to halve it again add…
Browse files Browse the repository at this point in the history
… export MALLOC_ARENA_MAX=2 (or 1) to your runscript on linux)
  • Loading branch information
miigotu committed Feb 26, 2016
1 parent 2f5e8ad commit 2d7e561
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d7e561

Please sign in to comment.