Browse Source

using meinheld worker for django

Patrick Falls 12 years ago
parent
commit
5f6707b7d7
2 changed files with 2 additions and 1 deletions
  1. 1 1
      django/setup.py
  2. 1 0
      installer.py

+ 1 - 1
django/setup.py

@@ -9,7 +9,7 @@ home = expanduser("~")
 def start(args):
   setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'")
   setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu",  home)
-  subprocess.Popen("gunicorn hello.wsgi:application -k gevent  -b 0.0.0.0:8080 -w " + str((args.max_threads * 2)) + " --log-level=critical", shell=True, cwd="django/hello")
+  subprocess.Popen("gunicorn hello.wsgi:application --worker-class=\"egg:meinheld#gunicorn_worker\"  -b 0.0.0.0:8080 -w " + str((args.max_threads * 2)) + " --log-level=critical", shell=True, cwd="django/hello")
   return 0
 def stop():
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)

+ 1 - 0
installer.py

@@ -175,6 +175,7 @@ class Installer:
     #
 
     self.__run_command("sudo easy_install -U 'gunicorn==0.17.2'")
+    self.__run_command("sudo pip install --upgrade meinheld")
     self.__run_command("sudo easy_install -U 'eventlet==0.12.1'")
     self.__run_command("sudo pip install --upgrade 'gevent==0.13.8'")