From: Michael Tremer Date: Thu, 7 Feb 2013 13:18:16 +0000 (+0000) Subject: Start as many frontends as CPU cores are available. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6d36e0ae7959a7536dc2c9e34b2c89ded9faf96;p=ipfire.org.git Start as many frontends as CPU cores are available. --- diff --git a/webapp/__init__.py b/webapp/__init__.py index a2477a39..94227092 100644 --- a/webapp/__init__.py +++ b/webapp/__init__.py @@ -1,6 +1,7 @@ #/usr/bin/python import logging +import multiprocessing import os.path import simplejson import tornado.httpserver @@ -253,7 +254,7 @@ class Application(tornado.web.Application): # frontends to get best performance out of our service. if not self.settings["debug"]: http_server.bind(port) - http_server.start(num_processes=4) + http_server.start(num_processes=multiprocessing.cpu_count()) else: http_server.listen(port)