From: Michael Tremer Date: Sat, 4 May 2013 17:25:03 +0000 (+0100) Subject: Start less CPU processes. X-Git-Url: http://git.ipfire.org/?p=people%2Fshoehn%2Fipfire.org.git;a=commitdiff_plain;h=cef37a4a5ffcd83d43e48676358d297d59492258 Start less CPU processes. --- diff --git a/webapp/__init__.py b/webapp/__init__.py index 9422709..f0e7c0b 100644 --- a/webapp/__init__.py +++ b/webapp/__init__.py @@ -250,11 +250,13 @@ class Application(tornado.web.Application): http_server = tornado.httpserver.HTTPServer(self, xheaders=True) + num_processes = multiprocessing.cpu_count() / 2 + # If we are not running in debug mode, we can actually run multiple # frontends to get best performance out of our service. if not self.settings["debug"]: http_server.bind(port) - http_server.start(num_processes=multiprocessing.cpu_count()) + http_server.start(num_processes=num_processes) else: http_server.listen(port)