setup.py 658 B

1234567891011121314151617181920212223242526
  1. import multiprocessing
  2. import subprocess
  3. import sys
  4. import setup_util
  5. import os
  6. import time
  7. uwsgi = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin/uwsgi')
  8. PROCS = multiprocessing.cpu_count()
  9. def start(args):
  10. subprocess.Popen(
  11. uwsgi + ' --master -L --gevent 1000 --http :8080 --http-keepalive ' +
  12. '-p ' + str(PROCS) + ' -w hello --add-header "Connection: keep-alive" ' +
  13. ' --pidfile /tmp/uwsgi.pid',
  14. shell=True, cwd="uwsgi")
  15. return 0
  16. def stop():
  17. try:
  18. subprocess.Popen(uwsgi + ' --stop /tmp/uwsgi.pid', shell=True, cwd="uwsgi")
  19. except OSError:
  20. pass
  21. time.sleep(1)
  22. return 0