SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
Docker: add UWSGI_WORKERS and UWSGI_THREAD environment variables (#2992)
Alexandre Flamentbd3f52685944
diff --git a/Dockerfile b/Dockerfileindex 053ab123a..d08d681c5 100644--- a/Dockerfile+++ b/Dockerfile@@ -15,7 +15,9 @@ ENV INSTANCE_NAME=searxng \MORTY_KEY= \MORTY_URL= \SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml \- UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini+ UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini \+ UWSGI_WORKERS=%k \+ UWSGI_THREADS=4WORKDIR /usr/local/searxngdiff --git a/dockerfiles/uwsgi.ini b/dockerfiles/uwsgi.iniindex 2d3155976..fc026b792 100644--- a/dockerfiles/uwsgi.ini+++ b/dockerfiles/uwsgi.ini@@ -4,8 +4,12 @@ uid = searxnggid = searxng# Number of workers (usually CPU count)-workers = %k-threads = 4+# default value: %k (= number of CPU core, see Dockerfile)+workers = $(UWSGI_WORKERS)++# Number of threads per worker+# default value: 4 (see Dockerfile)+threads = $(UWSGI_THREADS)# The right granted on the created socketchmod-socket = 666diff --git a/docs/admin/installation-docker.rst b/docs/admin/installation-docker.rstindex c667c4f44..09471891b 100644--- a/docs/admin/installation-docker.rst+++ b/docs/admin/installation-docker.rst@@ -92,6 +92,9 @@ instance using `docker run <https://docs.docker.com/engine/reference/run/>`_:searxng/searxng2f998.... # container's ID+The environment variables UWSGI_WORKERS and UWSGI_THREADS overwrite the default+number of UWSGI processes and UWSGI threads specified in `/etc/searxng/uwsgi.ini`.+Open your WEB browser and visit the URL:.. code:: shdiff --git a/utils/searxng.sh b/utils/searxng.shindex e04f87e10..197188a4a 100755--- a/utils/searxng.sh+++ b/utils/searxng.sh@@ -177,6 +177,7 @@ main() {case $1 in--getenv) var="$2"; echo "${!var}"; exit 0;;+ --cmd) shift; "$@";;-h|--help) usage; exit 0;;install)sudo_or_exitdiff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini b/utils/templates/etc/uwsgi/apps-archlinux/searxng.iniindex 351965a1e..650c8cc3f 100644--- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini+++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini@@ -47,6 +47,9 @@ plugin = python# default behaviour is for performance reasons.enable-threads = true+# Number of workers (usually CPU count)+workers = ${UWSGI_WORKERS:-%k}+threads = ${UWSGI_THREADS:-4}# plugin: python# --------------diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socketindex 0f36e4178..eb1220233 100644--- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket+++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket@@ -47,6 +47,9 @@ plugin = python# default behaviour is for performance reasons.enable-threads = true+# Number of workers (usually CPU count)+workers = ${UWSGI_WORKERS:-%k}+threads = ${UWSGI_THREADS:-4}# plugin: python# --------------diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini b/utils/templates/etc/uwsgi/apps-available/searxng.iniindex caefdf0bb..7d367d9ee 100644--- a/utils/templates/etc/uwsgi/apps-available/searxng.ini+++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini@@ -50,6 +50,9 @@ plugin = python3,http# default behaviour is for performance reasons.enable-threads = true+# Number of workers (usually CPU count)+workers = ${UWSGI_WORKERS:-%k}+threads = ${UWSGI_THREADS:-4}# plugin: python# --------------diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socketindex 516787be1..2f95fab7c 100644--- a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket+++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket@@ -50,6 +50,9 @@ plugin = python3,http# default behaviour is for performance reasons.enable-threads = true+# Number of workers (usually CPU count)+workers = ${UWSGI_WORKERS:-%k}+threads = ${UWSGI_THREADS:-4}# plugin: python# --------------