Pass max_workers to ThreadPoolExecutor
This commit is contained in:
+2
-1
@@ -8,6 +8,7 @@ import weakref
|
|||||||
import paramiko
|
import paramiko
|
||||||
import tornado.web
|
import tornado.web
|
||||||
|
|
||||||
|
from multiprocessing import cpu_count
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
from tornado.options import options
|
from tornado.options import options
|
||||||
@@ -168,7 +169,7 @@ class NotFoundHandler(MixinHandler, tornado.web.ErrorHandler):
|
|||||||
|
|
||||||
class IndexHandler(MixinHandler, tornado.web.RequestHandler):
|
class IndexHandler(MixinHandler, tornado.web.RequestHandler):
|
||||||
|
|
||||||
executor = ThreadPoolExecutor()
|
executor = ThreadPoolExecutor(max_workers=cpu_count()*5)
|
||||||
|
|
||||||
def initialize(self, loop, policy, host_keys_settings):
|
def initialize(self, loop, policy, host_keys_settings):
|
||||||
super(IndexHandler, self).initialize(loop)
|
super(IndexHandler, self).initialize(loop)
|
||||||
|
|||||||
Reference in New Issue
Block a user