Skip to content

Commit

Permalink
Merge pull request #122 from pwargulak/feature/OLMIS-7642-5
Browse files Browse the repository at this point in the history
OLMIS-7642: Use eventlet workers to improve request handling
  • Loading branch information
anawrotsoldevelo committed Feb 20, 2023
2 parents b224741 + faca475 commit 4b5c17f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reporting/config/services/superset/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
6 changes: 4 additions & 2 deletions reporting/superset/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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} && \
Expand Down

0 comments on commit 4b5c17f

Please sign in to comment.