Browse Source

Using async gevent worker.  Huge oversight for "CTO Outsourcing."

Brian Knapp 12 years ago
parent
commit
4d25b61a92
1 changed files with 10 additions and 4 deletions
  1. 10 4
      django/setup.py

+ 10 - 4
django/setup.py

@@ -1,4 +1,3 @@
-
 import subprocess
 import subprocess
 import sys
 import sys
 import setup_util
 import setup_util
@@ -6,8 +5,15 @@ import os
 
 
 def start(args):
 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", "HOST': '.*'", "HOST': '" + args.database_host + "'")
-
-  subprocess.Popen("gunicorn hello.wsgi:application -b 0.0.0.0:8080 -w " + str((args.max_threads * 2)) + " --log-level=critical", shell=True, cwd="django/hello")
+  # for the love of all that is good and right in the universe, use gevent worker
+  # if you're going to bother to use gunicorn.  meinheld is faster, but needs some work on 
+  # certain asynch support.
+  # $ easy_install pip
+  # $ pip install gevent
+  # not so difficult, is it?
+  # requires 5 minutes of searching
+  # so much for CTO Outsourcing
+  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")
   return 0
   return 0
 def stop():
 def stop():
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
@@ -20,4 +26,4 @@ def stop():
       except OSError:
       except OSError:
         pass
         pass
 
 
-  return 0
+  return 0