-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgunicorn_config.py
More file actions
44 lines (35 loc) · 1014 Bytes
/
Copy pathgunicorn_config.py
File metadata and controls
44 lines (35 loc) · 1014 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
41
42
43
# Gunicorn configuration file for STG Community Website
import multiprocessing
import os
# Server socket
bind = "127.0.0.1:8000"
backlog = 2048
# Worker processes
workers = int(os.getenv("STG_GUNICORN_WORKERS", multiprocessing.cpu_count() * 2 + 1))
worker_class = "uvicorn.workers.UvicornWorker"
worker_connections = 1000
timeout = 120
keepalive = 5
# Logging
accesslog = "-" # Log to stdout (captured by systemd)
errorlog = "-" # Log to stderr (captured by systemd)
loglevel = os.getenv("STG_LOG_LEVEL", "info")
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 = "stg_website"
# Server mechanics
daemon = False
pidfile = None
umask = 0
user = None
group = None
tmp_upload_dir = None
# SSL (if needed, uncomment and configure)
# keyfile = "/path/to/keyfile"
# certfile = "/path/to/certfile"
# Performance tuning
max_requests = 1000
max_requests_jitter = 50
preload_app = True
# Graceful timeout for worker restart
graceful_timeout = 30