Scaling deckhand uwsgi workers

Updated obsolete uwsgi default configuration parameters for better
performance.
Increased number of worker threads to increase performance.
Uplifted uwsgi to the latest for bug fixes since 2018.

For more info please see:
https://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html

Change-Id: Ifedb9c6279e64be86deb6ec375810c5ecf97958a
This commit is contained in:
Ahmad Mahmoudi 2020-08-03 16:56:56 +00:00
parent 033b278fd0
commit 0545625da9
4 changed files with 10 additions and 7 deletions

View File

@ -66,7 +66,7 @@ spec:
- name: 'DECKHAND_API_WORKERS'
value: {{ .Values.conf.uwsgi.workers | default 1 | quote }}
- name: 'DECKHAND_API_THREADS'
value: {{ .Values.conf.uwsgi.threads | default 4 | quote }}
value: {{ .Values.conf.uwsgi.threads | default 16 | quote }}
image: {{ .Values.images.tags.deckhand }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}

View File

@ -234,7 +234,7 @@ conf:
# SQLAlchemy engine pooled connection strings when workers > 1. As a
# workaround, we use multiple threads but only 1 worker. For more
# information, see: https://github.com/att-comdev/deckhand/issues/20
threads: 4
threads: 16
workers: 1
policy:
admin_api: role:admin

View File

@ -30,7 +30,7 @@ DECKHAND_API_TIMEOUT=${DECKHAND_API_TIMEOUT:-"600"}
# Number of uWSGI workers to handle API requests
DECKHAND_API_WORKERS=${DECKHAND_API_WORKERS:-"1"}
# Threads per worker
DECKHAND_API_THREADS=${DECKHAND_API_THREADS:-"4"}
DECKHAND_API_THREADS=${DECKHAND_API_THREADS:-"16"}
# The Deckhand configuration directory containing deckhand.conf
DECKHAND_CONFIG_DIR=${DECKHAND_CONFIG_DIR:-"/etc/deckhand"}
@ -43,13 +43,16 @@ if [ "$1" = 'server' ]; then
--die-on-term \
--enable-threads \
--http :${PORT} \
--http-timeout $DECKHAND_API_TIMEOUT \
--http-timeout ${DECKHAND_API_TIMEOUT} \
-L \
--lazy-apps \
--master \
--pyargv "--config-file ${DECKHAND_CONFIG_DIR}/deckhand.conf" \
--threads $DECKHAND_API_THREADS \
--workers $DECKHAND_API_WORKERS \
--threads ${DECKHAND_API_THREADS} \
--workers ${DECKHAND_API_WORKERS} \
--strict \
--vacuum \
--need-app \
-w deckhand.cmd
elif [ "$1" = 'alembic' ]; then
exec alembic ${@:2}

View File

@ -43,6 +43,6 @@ Routes==2.4.1
six==1.11.0
stevedore==1.30.0
urllib3==1.24.3
uwsgi==2.0.17.1
uwsgi~=2.0.19.1
# To support profiling in non-prod
Werkzeug==0.16.1