Skip to content

Commit

Permalink
Fix uWSGI configuration to handle write errors and optimize performance
Browse files Browse the repository at this point in the history
  • Loading branch information
mjanez committed Oct 8, 2024
1 parent 380abfb commit 52a80e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckan/setup/start_ckan.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ chown -R ckan:ckan $CKAN_LOGS_PATH/xloader
# Set the common uwsgi options.
## Add thunder-lock to prevent multiple workers from running the same job and buffer-size to prevent large headers
## To increase performance, you can adjust the number of processes (-p) (More info: https://uwsgi-docs.readthedocs.io/en/latest/Options.html & https://www.bloomberg.com/company/stories/configuring-uwsgi-production-deployment/)
# Fix uWSGI raises OSError: write error: https://stackoverflow.com/a/45393743
UWSGI_OPTS="--thunder-lock \
--ignore-sigpipe \
--ignore-write-errors \
--disable-write-exception \
--socket /tmp/uwsgi.sock \
--wsgi-file /srv/app/wsgi.py \
--module wsgi:application \
Expand All @@ -71,8 +74,8 @@ UWSGI_OPTS="--thunder-lock \
--harakiri $UWSGI_HARAKIRI \
--max-requests 500 \
--max-worker-lifetime 3600 \
--reload-on-rss 1024 \
--processes 2 \
--reload-on-rss 2048 \
--processes 4 \
--buffer-size 32768 \
--disable-logging \
--log-4xx \
Expand Down

0 comments on commit 52a80e4

Please sign in to comment.