Browse Source

Let uWSGI workers and threads be adjustable from env

Immánuel! 2 years ago
parent
commit
caf4785663
1 changed files with 6 additions and 0 deletions
  1. 6 0
      dockerfiles/docker-entrypoint.sh

+ 6 - 0
dockerfiles/docker-entrypoint.sh

@@ -61,6 +61,12 @@ echo "SearXNG version ${SEARXNG_VERSION}"
 # helpers to update the configuration files
 # helpers to update the configuration files
 patch_uwsgi_settings() {
 patch_uwsgi_settings() {
     CONF="$1"
     CONF="$1"
+
+    # update uwsg.ini
+    sed -i \
+        -e "s|workers = .*|workers = ${UWSGI_WORKERS:-%k}|g" \
+        -e "s|threads = .*|threads = ${UWSGI_THREADS:-4}|g" \
+        "${CONF}"
 }
 }
 
 
 patch_searxng_settings() {
 patch_searxng_settings() {