init
This commit is contained in:
39
web/gunicorn_conf.py
Normal file
39
web/gunicorn_conf.py
Normal file
@@ -0,0 +1,39 @@
|
||||
import os
|
||||
|
||||
from worker import ASYNC_MODE
|
||||
from config import DEBUG, PORT
|
||||
|
||||
bind = '0.0.0.0:{}'.format(PORT)
|
||||
backlog = 2048
|
||||
|
||||
if ASYNC_MODE == 'gevent':
|
||||
worker_class = 'gevent'
|
||||
|
||||
workers = os.cpu_count() if os.cpu_count() <= 4 else int(os.cpu_count() / 4) + 1
|
||||
preload_app = True
|
||||
|
||||
debug = False
|
||||
spew = False
|
||||
|
||||
timeout = 600
|
||||
|
||||
proc_name = 'app'
|
||||
|
||||
limit_request_line = 0 # 4094
|
||||
|
||||
# debug
|
||||
if DEBUG:
|
||||
loglevel = 'debug'
|
||||
graceful_timeout = 1
|
||||
reload = True
|
||||
# capture_output = True
|
||||
|
||||
else:
|
||||
loglevel = 'info'
|
||||
# errorlog = './gunicorn-error.log'
|
||||
# accesslog = './gunicorn-access.log'
|
||||
|
||||
try:
|
||||
from local_gunicorn_conf import * # noqa
|
||||
except ImportError:
|
||||
pass
|
Reference in New Issue
Block a user