gunicorn_conf.py 615 B

1234567891011121314151617181920212223242526
  1. import multiprocessing
  2. import os
  3. import sys
  4. _is_pypy = hasattr(sys, 'pypy_version_info')
  5. _is_travis = os.environ.get('TRAVIS') == 'true'
  6. workers = multiprocessing.cpu_count() * 3
  7. if _is_travis:
  8. workers = 2
  9. bind = "0.0.0.0:8080"
  10. keepalive = 120
  11. errorlog = '-'
  12. pidfile = 'gunicorn.pid'
  13. if _is_pypy:
  14. worker_class = "tornado"
  15. else:
  16. worker_class = "meinheld.gmeinheld.MeinheldWorker"
  17. def post_fork(server, worker):
  18. # Disable access log.
  19. # (Until https://github.com/mopemope/meinheld/pull/42 is released)
  20. import meinheld.server
  21. meinheld.server.set_access_logger(None)