-
Notifications
You must be signed in to change notification settings - Fork 2
/
uwsgi.ini
91 lines (64 loc) · 2.09 KB
/
uwsgi.ini
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[uwsgi]
module = run
callable = application
need-app = true
py-autoreload = 1
socket = /tmp/uwsgi.sock
chown-socket = nginx:nginx
chmod-socket = 664
; # Graceful shutdown on SIGTERM, see https://github.com/unbit/uwsgi/issues/849#issuecomment-118869386
hook-master-start = unix_signal:15 gracefully_kill_them_all
uid = nginx
gid = nginx
env = HOME=/home/nginx
### Worker scaling
# maximum number of workers
processes = 8
# https://uwsgi-docs.readthedocs.io/en/latest/Cheaper.html#busyness-cheaper-algorithm
cheaper-algo = busyness
# Time window for tracking average busyness
cheaper-overload = 20
# Number of idle cycles before stopping a worker
cheaper-busyness-multiplier = 3
# Minimum number of workers
cheaper = 2
# Start with 8 workers
cheaper-initial = 2
# Spawn at most 8 workers at once
cheaper-step = 4
# Start spawning more workers at 60% busyness
cheaper-busyness-max = 60
# Start killing workers if busyness falls below 20%
cheaper-busyness-min = 20
### Reloads and limitations
# max socket listen queue length - requires net.somaxconn increase
listen = 128
# Max request header size
buffer-size = 4096
# Don't spawn new workers if total memory over 6 GiB
cheaper-rss-limit-soft = 6442450944
# Reload worker after serving X requests
max-requests = 5000
# Grace period for single worker to reload/shutdown
worker-reload-mercy = 600
# Grace period for all workers and processes to reload/shutdown
reload-mercy = 605
# Kill stuck/unresponsive processes after 20 minutes
harakiri = 1200
### Misc
# Maintain Python thread support
enable-threads = true
# Required for cheaper-rss-limit-soft
memory-report = true
# Additional log output for harakiri
harakiri-verbose = true
### Logging
# Filter our own pre-formated app messages and pass them through
logger = applog stdio
log-route = applog "source":
# Wrap everything that looks like uWSGI in a single JSON+newline
logger = uWSGIlog stdio
log-route = uWSGIlog address space usage
log-route = uWSGIlog uwsgi
log-encoder = json:uWSGIlog {"source":"uWSGI","time":"${strftime:%Y-%m-%dT%H:%M:%S.000Z}","severity":"info","message":"${msg}"}
log-encoder = nl:uWSGIlog