Skip to content

Commit

Permalink
Optimize uWSGI configuration for improved performance and resource ma…
Browse files Browse the repository at this point in the history
…nagement
  • Loading branch information
mjanez authored Sep 23, 2024
1 parent c0185a5 commit ee9bfa1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ckan/setup/start_ckan.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ 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/)
UWSGI_OPTS="--thunder-lock \
--buffer-size=65535 \
--ignore-sigpipe \
Expand All @@ -66,8 +67,18 @@ UWSGI_OPTS="--thunder-lock \
--http [::]:5000 \
--master --enable-threads \
--lazy-apps \
-p 2 -L -b 32768 --vacuum \
--harakiri $UWSGI_HARAKIRI"
--vacuum \
--harakiri $UWSGI_HARAKIRI \
--max-requests 500 \
--max-worker-lifetime 3600 \
--reload-on-rss 1024 \
--processes 3 \
--buffer-size 32768 \
--disable-logging \
--log-4xx \
--log-5xx \
--auto-procname \
--procname-prefix-spaced 'ckan '"

if [ $? -eq 0 ]
then
Expand Down

0 comments on commit ee9bfa1

Please sign in to comment.