[scripts] add environments UWSGI_WORKERS and UWSGI_THREADS

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

Templates for uwsgi scripts can be tested by::

    UWSGI_WORKERS=8 UWSGI_THREADS=9 \
      ./utils/searxng.sh --cmd\
      eval "echo \"$(cat utils/templates/etc/uwsgi/*/searxng.ini*)\""\
      | grep "workers\|threads"

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2023-11-05 14:09:11 +01:00
parent 17ca7eb514
commit e4429ea520
5 changed files with 13 additions and 0 deletions

View file

@ -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_exit

View file

@ -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
# --------------

View file

@ -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
# --------------

View file

@ -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
# --------------

View file

@ -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
# --------------