Explorar o código

worker class gevent processes concurrent requests

with no worker class specified, it is using 'sync' which is essentially just those four forked processes, which in python means: slower than a single process. gevent will give better performance.
sp1d3rx %!s(int64=12) %!d(string=hai) anos
pai
achega
94b696c5f6
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      flask/setup.py

+ 2 - 2
flask/setup.py

@@ -5,7 +5,7 @@ import os
 
 def start(args):
   setup_util.replace_text("flask/app.py", "DBHOSTNAME", args.database_host)
-  subprocess.Popen("gunicorn app:app -b 0.0.0.0:8080 -w " + str((args.max_threads * 2)) + " --log-level=critical", shell=True, cwd="flask")
+  subprocess.Popen("gunicorn app:app -b 0.0.0.0:8080 -w " + str((args.max_threads * 2)) + " --worker-class gevent --log-level=critical", shell=True, cwd="flask")
   
   return 0
 
@@ -20,4 +20,4 @@ def stop():
       except OSError:
         pass
   
-  return 0
+  return 0