From 80b787eb0813775dbff3d7e3f2c14393e42ada76 Mon Sep 17 00:00:00 2001 From: Mark Burnett Date: Wed, 17 Jan 2018 15:16:06 -0600 Subject: [PATCH] Make the uWSGI http-timeout configurable When testing Promenade integration, I found that it was taking more than the default 60 second timeout to render documents. Change-Id: Id0ee7ea30b901a60eb95df06a3d25ce4c8689a8a --- charts/deckhand/templates/deployment.yaml | 2 ++ entrypoint.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/charts/deckhand/templates/deployment.yaml b/charts/deckhand/templates/deployment.yaml index 64276285..ddfa972a 100644 --- a/charts/deckhand/templates/deployment.yaml +++ b/charts/deckhand/templates/deployment.yaml @@ -45,6 +45,8 @@ spec: containers: - name: deckhand env: + - name: 'DECKHAND_API_TIMEOUT' + value: {{ .Values.conf.uwsgi.timeout | default 600 | quote }} - name: 'DECKHAND_API_WORKERS' value: {{ .Values.conf.uwsgi.workers | default 4 | quote }} - name: 'DECKHAND_API_THREADS' diff --git a/entrypoint.sh b/entrypoint.sh index 21b9ae7f..debce75e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,6 +18,8 @@ set -ex # Define port PORT=${PORT:-9000} +# How long uWSGI should wait for each deckhand response +DECKHAND_API_TIMEOUT=${DECKHAND_API_TIMEOUT:-"600"} # Number of uWSGI workers to handle API requests DECKHAND_API_WORKERS=${DECKHAND_API_WORKERS:-"4"} # Threads per worker @@ -28,6 +30,7 @@ exec uwsgi \ --http :${PORT} \ -w deckhand.cmd \ --callable deckhand_callable \ + --http-timeout $DECKHAND_API_TIMEOUT \ --enable-threads \ -L \ --pyargv "--config-file /etc/deckhand/deckhand.conf" \