From 5422d4e14c548c1af30fbe838c7debf54980a57f Mon Sep 17 00:00:00 2001 From: pictuga Date: Thu, 25 Nov 2021 21:21:59 +0100 Subject: [PATCH] Move away from gevent Might not be that reliable --- Dockerfile | 2 +- README.md | 8 +++----- docker-entry.sh | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) mode change 100644 => 100755 docker-entry.sh diff --git a/Dockerfile b/Dockerfile index fa42653..ff55d4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest -RUN apk add --no-cache python3 py3-pip py3-wheel git py3-lxml py3-gevent py3-zope-interface py3-zope-event +RUN apk add --no-cache python3 py3-pip py3-wheel git py3-lxml ADD . /app RUN pip3 install --no-cache-dir /app[full] diff --git a/README.md b/README.md index 06d3d78..bf0dc20 100644 --- a/README.md +++ b/README.md @@ -109,9 +109,6 @@ packages: - python3-pip - python3-wheels - python3-lxml - - python3-gevent - - python3-zope.interface - - python3-zope.event - git - ca-certificates @@ -125,7 +122,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 ${WORKERS:-4} --worker-class=gevent --preload --access-logfile - morss + - gunicorn --bind 0.0.0.0:${PORT:-8000} --workers ${WORKERS:-4} --threads ${THREADS:-4} --preload --access-logfile - morss ``` ## Run @@ -393,7 +390,8 @@ 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 +- `WORKERS` and `THREADS` (number) sets the number of gunicorn workers and +threads 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 diff --git a/docker-entry.sh b/docker-entry.sh old mode 100644 new mode 100755 index 0bbf956..ede237b --- a/docker-entry.sh +++ b/docker-entry.sh @@ -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 ${WORKERS:-4} --worker-class=gevent --preload --access-logfile - morss + gunicorn --bind 0.0.0.0:${PORT:-8000} --workers ${WORKERS:-4} --threads ${THREADS:-4} --preload --access-logfile - morss else morss $@ diff --git a/setup.py b/setup.py index 9ef5cf2..78aa2c8 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( license = 'AGPL v3', packages = [package_name], install_requires = ['lxml', 'bs4', 'python-dateutil', 'chardet'], - extras_require = {'full': ['pymysql', 'redis', 'diskcache', 'gunicorn', 'gevent']}, + extras_require = {'full': ['pymysql', 'redis', 'diskcache', 'gunicorn']}, package_data = {package_name: ['feedify.ini']}, data_files = [ ('share/' + package_name, ['README.md', 'LICENSE']),