From e6d36e0ae7959a7536dc2c9e34b2c89ded9faf96 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 7 Feb 2013 13:18:16 +0000 Subject: [PATCH] Start as many frontends as CPU cores are available. --- webapp/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.47.3