infra_snippets/kubernetes/autoscale/service/gunicorn.conf.py

11 lines
226 B
Python
Raw Normal View History

2021-07-25 01:23:40 +00:00
import multiprocessing
import os
env_port = int(os.environ.get("PORT", 8080))
bind = f"0.0.0.0:{env_port}"
workers = max(2, multiprocessing.cpu_count() * 2 + 1)
preload_app = True
max_requests = 100
max_requests_jitter = 50