Files
notifications-admin/gunicorn_config.py

25 lines
661 B
Python
Raw Normal View History

2024-06-20 16:14:07 -07:00
import multiprocessing
import os
import sys
import traceback
2025-08-07 11:51:25 -07:00
import gunicorn
2020-07-01 13:27:12 +01:00
2024-06-12 13:42:04 -07:00
# Let gunicorn figure out the right number of workers
2024-06-21 09:22:20 -07:00
# The recommended formula is cpu_count() * 2 + 1
# but we have an unusual configuration with a lot of cpus and not much memory
# so adjust it.
workers = multiprocessing.cpu_count()
worker_class = "gevent"
2025-07-30 10:51:54 -07:00
timeout = 240
bind = "0.0.0.0:{}".format(os.getenv("PORT"))
disable_redirect_access_to_syslog = True
gunicorn.SERVER_SOFTWARE = "None"
def worker_abort(worker):
worker.log.info("worker received ABORT")
for stack in sys._current_frames().values():
worker.log.error("".join(traceback.format_stack(stack)))