-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuwsgi.ini
46 lines (44 loc) · 1.98 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
[uwsgi]
project = djsani
suffix = production
plugins = python3
venv = /data2/python_venv/3.10
base = %(venv)/%(project)/lib/django-%(project)
pythonpath = %(venv)/%(project)/lib/python3.10/
chdir = %(base)/%(project)
home = %(venv)/%(project)/
module = %(project).wsgi:application
env = DJANGO_SETTINGS_MODULE=%(project).settings.%(suffix)
touch-reload = %(base)/%(project)/wsgi.py
max-requests=5000
socket = %(base)/uwsgi/%(project).socket
chmod-socket = 666
logto = /var/log/uwsgi/%(project)_%(suffix).log
pidfile=/tmp/uwsgi-%(project)_%(suffix).pid
uid = www-data
gui = www-data
enable-threads=false
# number of worker processes
processes = 48
workers = 36
master = true
# increasing buffer-size prevents errors like:
# invalid request block size: 4338 (max 4096)...skip
# on big POST or GET requests
buffer-size = 65535
# clear environment on exit
vacuum = true
max-requests = 1000 ; Restart workers after this many requests
max-worker-lifetime = 3600 ; Restart workers after this many seconds
reload-on-rss = 2048 ; Restart workers after this much resident memory
worker-reload-mercy = 60 ; How long to wait before forcefully killing workers
cheaper-algo = busyness
cheaper = 12 ; Minimum number of workers allowed
cheaper-initial = 12 ; Workers created at startup
cheaper-overload = 1 ; Length of a cycle in seconds
cheaper-step = 2 ; How many workers to spawn at a time
cheaper-busyness-multiplier = 30 ; How many cycles to wait before killing workers
cheaper-busyness-min = 20 ; Below this threshold, kill workers (if stable for multiplier cycles)
cheaper-busyness-max = 70 ; Above this threshold, spawn new workers
cheaper-busyness-backlog-alert = 16 ; Spawn emergency workers if more than this many requests are waiting in the queue
cheaper-busyness-backlog-step = 2 ; How many emergegency workers to create if there are too many requests in the queue