|
@@ -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
|