From faca475f261e27d90c3018322580c183f41c2490 Mon Sep 17 00:00:00 2001 From: Piotr Wargulak Date: Mon, 20 Feb 2023 11:10:22 +0100 Subject: [PATCH] OLMIS-7642: Use eventlet workers to improve request handling --- reporting/config/services/superset/init.sh | 2 +- reporting/superset/Dockerfile | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/reporting/config/services/superset/init.sh b/reporting/config/services/superset/init.sh index 82e36c9..a3e5aa2 100755 --- a/reporting/config/services/superset/init.sh +++ b/reporting/config/services/superset/init.sh @@ -31,4 +31,4 @@ superset import_datasources -p $CONFIG_DIR/datasources/database.yaml && superset import_dashboards -u ${SUPERSET_ADMIN_USERNAME} -p $CONFIG_DIR/dashboards/openlmis_uat_dashboards.zip && superset init && -gunicorn -w 2 --timeout 60 -b 0.0.0.0:8088 --reload --limit-request-line 0 --limit-request-field_size 0 "superset.app:create_app()" +gunicorn -w 2 -k eventlet --timeout 60 -b 0.0.0.0:8088 --reload --limit-request-line 0 --limit-request-field_size 0 "superset.app:create_app()" diff --git a/reporting/superset/Dockerfile b/reporting/superset/Dockerfile index 01d015b..1f1625d 100644 --- a/reporting/superset/Dockerfile +++ b/reporting/superset/Dockerfile @@ -23,8 +23,9 @@ ENV GUNICORN_BIND=0.0.0.0:8088 \ SUPERSET_PATCHUP_VERSION=${SUPERSET_PATCHUP_VERSION} \ SUPERSET_PATCHUP_REPO=https://github.com/OpenLMIS/superset-patchup.git@${SUPERSET_PATCHUP_VERSION} \ SUPERSET_HOME=/var/lib/superset \ - APP_DIR=${APP_DIR} -ENV GUNICORN_CMD_ARGS="--workers ${GUNICORN_WORKERS} --timeout ${GUNICORN_TIMEOUT} --bind ${GUNICORN_BIND} --limit-request-line ${GUNICORN_LIMIT_REQUEST_LINE} --limit-request-field_size ${GUNICORN_LIMIT_REQUEST_FIELD_SIZE}" + APP_DIR=${APP_DIR} \ + WORKER_CLASS=eventlet +ENV GUNICORN_CMD_ARGS="--workers ${GUNICORN_WORKERS} -k ${WORKER_CLASS} --timeout ${GUNICORN_TIMEOUT} --bind ${GUNICORN_BIND} --limit-request-line ${GUNICORN_LIMIT_REQUEST_LINE} --limit-request-field_size ${GUNICORN_LIMIT_REQUEST_FIELD_SIZE}" COPY requirements.txt requirements.txt @@ -68,6 +69,7 @@ RUN useradd -U -m superset && \ sqlalchemy-bigquery==1.4.4 \ clickhouse-sqlalchemy==0.1.10 \ sqlalchemy-redshift==0.8.11 \ + eventlet==0.24.1 \ git+${SUPERSET_PATCHUP_REPO} \ apache-superset==${SUPERSET_VERSION} \ apache-superset[cors]==${SUPERSET_VERSION} && \