Files
material-api/web/gunicorn_conf.py

40 lines
677 B
Python
Raw Permalink Normal View History

2024-05-29 10:21:31 +08:00
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