Compare commits

...

3 Commits

Author SHA1 Message Date
pictuga 1837eda25f heroku: add WORKERS to env vars
continuous-integration/drone/push Build is failing Details
2021-11-24 21:40:46 +01:00
pictuga 321763710d heroku: make env var customizable 2021-11-24 21:40:34 +01:00
pictuga e79c426c6e Add ability to change workers count for gunicorn 2021-11-24 21:36:28 +01:00
4 changed files with 24 additions and 9 deletions

View File

@ -125,7 +125,7 @@ write_files:
runcmd:
- update-ca-certificates
- pip install git+https://git.pictuga.com/pictuga/morss.git#egg=morss[full]
- gunicorn --bind 0.0.0.0:${PORT:-8000} --workers 4 --worker-class=gevent --preload --access-logfile - morss
- gunicorn --bind 0.0.0.0:${PORT:-8000} --workers ${WORKERS:-4} --worker-class=gevent --preload --access-logfile - morss
```
## Run
@ -393,6 +393,7 @@ debugging.
- `IGNORE_SSL=1`: to ignore SSL certs when fetch feeds and articles
- `DELAY` (seconds) sets the browser cache delay, only for HTTP clients
- `TIMEOUT` (seconds) sets the HTTP timeout when fetching rss feeds and articles
- `WORKERS` (number) sets the number of gunicorn workers to use
When parsing long feeds, with a lot of items (100+), morss might take a lot of
time to parse it, or might even run into a memory overflow on some shared

View File

@ -1 +1,21 @@
{"stack": "container"}
{
"stack": "container",
"env": {
"DEBUG": {
"value": 1,
"required": false
},
"WORKERS": {
"value": 4,
"required": false
},
"CACHE": {
"value": "diskcache",
"required": false
},
"CACHE_SIZE": {
"value": 1073741824,
"required": false
}
}
}

2
docker-entry.sh 100755 → 100644
View File

@ -4,7 +4,7 @@ if [ "$1" = "sh" ] || [ "$1" = "bash" ]; then
exec $@
elif [ -z "$1" ] || [ "$@" = "run" ]; then
gunicorn --bind 0.0.0.0:${PORT:-8000} --workers 4 --worker-class=gevent --preload --access-logfile - morss
gunicorn --bind 0.0.0.0:${PORT:-8000} --workers ${WORKERS:-4} --worker-class=gevent --preload --access-logfile - morss
else
morss $@

View File

@ -1,9 +1,3 @@
setup:
config:
DEBUG: 1
CACHE: diskcache
CACHE_SIZE: 1073741824
build:
docker:
web: Dockerfile