Browse Source

uwsgi: Support Python3. Stop accless logging to stdout.

INADA Naoki 12 years ago
parent
commit
a498b38e57
3 changed files with 31 additions and 3 deletions
  1. 7 1
      uwsgi/benchmark_config
  2. 5 2
      uwsgi/setup.py
  3. 19 0
      uwsgi/setup3.py

+ 7 - 1
uwsgi/benchmark_config

@@ -5,7 +5,13 @@
       "setup_file": "setup",
       "json_url": "/json",
       "port": 8080,
-      "sort": 29
+      "sort": 244
+    },
+    "py3": {
+      "setup_file": "setup3",
+      "json_url": "/json",
+      "port": 8080,
+      "sort": 245
     }
   }]
 }

+ 5 - 2
uwsgi/setup.py

@@ -2,16 +2,19 @@
 import subprocess
 import sys
 import setup_util
+import os
+
+uwsgi = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin/uwsgi')
 
 
 def start(args):
-    subprocess.Popen('uwsgi --gevent 1000 --http :8080 -w hello --pidfile /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+    subprocess.Popen(uwsgi + ' -L --gevent 1000 --http :8080 -w hello --pidfile /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
     return 0
 
 
 def stop():
     try:
-        subprocess.Popen('uwsgi --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+        subprocess.Popen(uwsgi + ' --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
     except OSError:
         pass
     return 0

+ 19 - 0
uwsgi/setup3.py

@@ -0,0 +1,19 @@
+import subprocess
+import sys
+import setup_util
+import os
+
+uwsgi = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin/uwsgi')
+
+
+def start(args):
+    subprocess.Popen(uwsgi + ' -L --gevent 1000 --http :8080 -w hello --pidfile /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+    return 0
+
+
+def stop():
+    try:
+        subprocess.Popen(uwsgi + ' --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+    except OSError:
+        pass
+    return 0