-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgunicorn.conf.py
More file actions
40 lines (31 loc) · 815 Bytes
/
gunicorn.conf.py
File metadata and controls
40 lines (31 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""Gunicorn production configuration"""
import multiprocessing
import os
from dotenv import load_dotenv
load_dotenv()
# Server socket
bind = f"{os.getenv('HOST', '0.0.0.0')}:{os.getenv('PORT', '8181')}"
backlog = 2048
# Worker processes
workers = int(os.getenv("WORKERS", multiprocessing.cpu_count() * 2 + 1))
worker_class = "uvicorn.workers.UvicornWorker"
worker_connections = 1000
timeout = 30
keepalive = 2
# Logging
loglevel = os.getenv("LOG_LEVEL", "info")
accesslog = "-" # stdout
errorlog = "-" # stderr
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(D)s'
# Process naming
proc_name = "turkiye-api-py"
# Server mechanics
daemon = False
pidfile = None
umask = 0
user = None
group = None
tmp_upload_dir = None
# SSL (if needed)
# keyfile = None
# certfile = None