Skip to content

Commit

Permalink
chore: gunicorn logging + gevent worker + increased timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Dec 6, 2023
1 parent 977d3b2 commit 7fadd24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions container.requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
gunicorn==21.2.0
gevent==23.9.1
pysam>=0.22.0,<0.23.0
fasta-checksum-utils>=0.3.1,<0.4
7 changes: 6 additions & 1 deletion run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
# Start Celery worker with log level dependent on BENTO_DEBUG
echo "[bento_wes] [entrypoint] Starting celery worker"
celery_log_level="INFO"
gunicorn_log_level="info"
if [[
"${BENTO_DEBUG}" == "true" ||
"${BENTO_DEBUG}" == "True" ||
"${BENTO_DEBUG}" == "1"
]]; then
celery_log_level="DEBUG"
gunicorn_log_level="debug"
fi
celery --app bento_wes.app worker --loglevel="${celery_log_level}" &

Expand All @@ -20,6 +22,9 @@ echo "[bento_wes] [entrypoint] Starting gunicorn"
# using 1 worker, multiple threads
# see https://stackoverflow.com/questions/38425620/gunicorn-workers-and-threads
gunicorn bento_wes.app:application \
--log-level "${gunicorn_log_level}" \
--timeout 660 \
--workers 1 \
--worker-class 'gevent' \
--threads "$(( 2 * $(nproc --all) + 1))" \
--bind "0.0.0.0:${INTERNAL_PORT}"
--bind "0.0.0.0:${INTERNAL_PORT}" \

0 comments on commit 7fadd24

Please sign in to comment.