Browse Source

uwsgi: Remove uwsgi-py3 (gevent doesn't support Python 3 yet)

INADA Naoki 12 years ago
parent
commit
93bcc495d7
3 changed files with 9 additions and 28 deletions
  1. 0 6
      uwsgi/benchmark_config
  2. 9 3
      uwsgi/setup.py
  3. 0 19
      uwsgi/setup3.py

+ 0 - 6
uwsgi/benchmark_config

@@ -6,12 +6,6 @@
       "json_url": "/json",
       "json_url": "/json",
       "port": 8080,
       "port": 8080,
       "sort": 244
       "sort": 244
-    },
-    "py3": {
-      "setup_file": "setup3",
-      "json_url": "/json",
-      "port": 8080,
-      "sort": 245
     }
     }
   }]
   }]
 }
 }

+ 9 - 3
uwsgi/setup.py

@@ -1,14 +1,19 @@
-
+import multiprocessing
 import subprocess
 import subprocess
 import sys
 import sys
 import setup_util
 import setup_util
 import os
 import os
+import time
 
 
 uwsgi = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin/uwsgi')
 uwsgi = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin/uwsgi')
-
+PROCS = multiprocessing.cpu_count()
 
 
 def start(args):
 def start(args):
-    subprocess.Popen(uwsgi + ' -L --gevent 1000 --http :8080 -w hello --pidfile /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
+    subprocess.Popen(
+        uwsgi + ' --master -L --gevent 1000 --http :8080 --http-keepalive ' +
+        '-p ' + str(PROCS) + ' -w hello --add-header "Connection: keep-alive" ' +
+        ' --pidfile /tmp/uwsgi.pid',
+        shell=True, cwd="uwsgi")
     return 0
     return 0
 
 
 
 
@@ -17,4 +22,5 @@ def stop():
         subprocess.Popen(uwsgi + ' --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
         subprocess.Popen(uwsgi + ' --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
     except OSError:
     except OSError:
         pass
         pass
+    time.sleep(1)
     return 0
     return 0

+ 0 - 19
uwsgi/setup3.py

@@ -1,19 +0,0 @@
-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