Skip to content

Commit 8519335

Browse files
szachovyCopilot
andcommitted
Override Gunicorn to use gevent workers
Replace default run-server.sh with explicit Gunicorn config: 4 workers, gevent worker class, 120s timeout, forwarded-allow-ips for Nginx proxy. Install gevent in the Dockerfile. Gevent async I/O prevents sync worker blocking during concurrent MySQL/Redis I/O operations. Closes #80 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ab8ce7 commit 8519335

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Dependabot updates for `github-actions` and `terraform` ecosystems. (#29)
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
18+
* Gunicorn gevent workers (4 workers, 120s timeout) for async I/O concurrency. (#80)
1819

1920
### Changed
2021

services/superset/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN \
1717
pip \
1818
install \
1919
--no-cache-dir \
20+
"gevent==24.2.1" \
2021
"redis==4.5.4" \
2122
"mysql-connector-python==9.0.0"
2223

services/superset/entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ if superset test_db \
1717
superset init
1818

1919
/app/set_database_uri.exp
20-
/usr/bin/run-server.sh &
20+
gunicorn \
21+
--bind 0.0.0.0:8088 \
22+
--workers 4 \
23+
--worker-class gevent \
24+
--timeout 120 \
25+
--limit-request-line 8190 \
26+
--forwarded-allow-ips "*" \
27+
"superset.app:create_app()" &
2128

2229
celery \
2330
--app superset.tasks.celery_app:app worker \

0 commit comments

Comments
 (0)