Docker: add UWSGI_WORKERS and UWSGI_THREAD.

UWSGI_WORKERS specifies the number of process.
UWSGI_THREADS specifies the number of threads.

The Docker convention is to specify the whole configuration
through environment variables. While not done in SearXNG, these two
additional variables allows admins to skip uwsgi.ini

In additional, https://github.com/searxng/preview-environments starts Docker
without additional files through searxng-helm-chat.
Each instance consumes 1Go of RAM which is a lot especially when there are a
lot of instances / pull requests.
This commit is contained in:
Alexandre Flament 2023-11-05 10:53:33 +00:00
parent 96ccec1aa6
commit 17ca7eb514
3 changed files with 12 additions and 3 deletions

View file

@ -4,8 +4,12 @@ uid = searxng
gid = 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 socket
chmod-socket = 666