Skip to content

Commit 82ecc93

Browse files
authored
uwsgi: bump workers + add max-requests/harakiri (#204)
processes 2->4, threads 4->8 (8 -> 32 concurrent slots) so a few slow requests don't saturate the worker pool.
1 parent 2db56fa commit 82ecc93

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

deploy/uwsgi.ini

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ http = 127.0.0.1:8000
33
virtualenv = /usr/lib/adx/venv
44
wsgi-file = /usr/lib/adx/submodules/ckan/wsgi.py
55
callable = application
6-
processes = 2
7-
threads = 4
6+
processes = 4
7+
threads = 8
88
enable-threads = true
99
master = true
10+
# Recycle workers after N requests to bound SQLAlchemy session-cache
11+
# and Python heap growth; without this, per-request latency climbs
12+
# within a single worker's lifetime under sustained load.
13+
max-requests = 500
14+
# Time-bound a request so a hung handler can't pin one of the 32 slots
15+
# indefinitely (e.g. a slow downstream call). harakiri-verbose logs
16+
# a Python traceback for whichever frame was running when killed.
17+
harakiri = 60
18+
harakiri-verbose = true

0 commit comments

Comments
 (0)