Skip to content

Commit 525a0d2

Browse files
swrichardsalextreme
authored andcommitted
Remove max-requests and add die-on-term uwsgi flag from docker start script
We've been seeing issues in k8s whereby the uwsgi pod would hang after 10 minutes and persist in a "Terminated" state. The theory is that the max_requests limit is reached, uwsgi tries to restart and k8s interprets this as a failing pod that needs to be replaced, but never is because k8s sends SIGTERM and uwsgi ignores this without the --die-on-term flag. This addresses both issues.
1 parent b1653c3 commit 525a0d2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bin/docker_start.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ uwsgi_port=${UWSGI_PORT:-8000}
1616
uwsgi_processes=${UWSGI_PROCESSES:-4}
1717
uwsgi_threads=${UWSGI_THREADS:-8}
1818
uwsgi_http_timeout=${UWSGI_HTTP_TIMEOUT:-120}
19-
uwsgi_max_requests=${UWSGI_MAX_REQUESTS:-100}
2019

2120
# Apply database migrations
2221
>&2 echo "Apply database migrations"
@@ -25,9 +24,9 @@ python src/manage.py migrate
2524
# Start server
2625
>&2 echo "Starting server"
2726
exec uwsgi \
27+
--die-on-term \
2828
--http :$uwsgi_port \
2929
--http-keepalive \
30-
--max-requests $uwsgi_max_requests \
3130
--http-timeout $uwsgi_http_timeout \
3231
--module open_inwoner.wsgi \
3332
--static-map /static=/app/static \

0 commit comments

Comments
 (0)