Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize gunicorn startup options #41

Merged
merged 2 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For actinia_core development, run and enter the running container (in a separate
```
docker-compose run --rm --entrypoint /bin/bash -v $HOME/repos/actinia_core/src:/src/actinia_core/src actinia-core

docker-compose -f docker-compose-dev.yml run --rm --entrypoint /bin/bash -v $HOME/repos/actinia/actinia_core/src:/src/actinia_core/src -v $HOME/repos/actinia/actinia_core/scripts:/src/actinia_core/scripts actinia-core
docker-compose -f docker-compose-dev.yml run --rm --entrypoint /bin/bash -v $HOME/repos/actinia/actinia_core/src:/src/actinia_core/src -v $HOME/repos/actinia/actinia_core/scripts:/src/actinia_core/scripts actinia-core```
```

Inside the container, you can run GRASS GIS with:
Expand Down Expand Up @@ -71,7 +71,7 @@ python3 setup.py install
bash /src/start-dev.sh

# python3 -m actinia_core.main
gunicorn -b 0.0.0.0:8088 -w 1 actinia_core.main:flask_app
gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app

```
If you have problems with cache, run
Expand Down
4 changes: 3 additions & 1 deletion docker/actinia-core-prod/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ grass -text -e -c 'EPSG:4326' /actinia_core/grassdb/latlong_wgs84
# created here, because set in sample config as default location
grass -text -e -c 'EPSG:3358' /actinia_core/grassdb/nc_spm_08

gunicorn -b 0.0.0.0:8088 -w 1 actinia_core.main:flask_app
# optimized gunicorn settings (http://docs.gunicorn.org/en/stable/design.html) # recommended num of workers is (2 x $num_cores) + 1, here minimum is assumed.
# If deployed with 8 replicas, each will run with 3 workers.
gunicorn -b 0.0.0.0:8088 -w 3 --access-logfile=- -k gthread actinia_core.main:flask_app
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start actinia_core/main.py: $status"
Expand Down
4 changes: 3 additions & 1 deletion docker/actinia-core/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ if [ $status -ne 0 ]; then
exit $status
fi

gunicorn -b 0.0.0.0:8088 -w 1 actinia_core.main:flask_app
# optimized gunicorn settings (http://docs.gunicorn.org/en/stable/design.html) # run only 1 worker for debugging reasons. This is overwritten for production
# deployment.
gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app
status=$?
if [ $status -ne 0 ]; then
echo "Failed to start actinia_core/main.py: $status"
Expand Down