-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Docker: add UWSGI_WORKERS and UWSGI_THREAD environment variables #2992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can you add these new envs into the list: https://github.com/searxng/searxng/blob/master/Dockerfile#L18? Thank you |
761cca9 to
9babefb
Compare
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.
9babefb to
17ca7eb
Compare
|
Done. Important note: this work with new installations, older installation keep the previous version of |
- 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>
|
Added a commit on top that adds the same environment to the script installation procedure. One question I have: should we also set AFAIK the |
|
The number of offload-threads never appeared to be an issue as far I know. |
I have seen these lines in my review, but I think we can't ... The template is copied with out a replacement from the environment: searxng/dockerfiles/docker-entrypoint.sh Lines 132 to 133 in 76b91a3
Now we have a uwsg.ini with the raw strings Lines 8 to 12 in 76b91a3
After the copy this raw strings will be patched by searxng/dockerfiles/docker-entrypoint.sh Lines 132 to 134 in 76b91a3
@dalf: after rethinking about theses lines; its no longer clear to me if it was intended. When should .. can you have a look / thanks! |
|
I think these lines can be also removed searxng/dockerfiles/docker-entrypoint.sh Lines 62 to 70 in 76b91a3
(reposting with the correct account) |
What does this PR do?
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. With
UWSGI_WORKERS=1each instance consume about 250Mo.Why is this change important?
How to test this PR locally?
make docker.builddocker run --rm -ti -p 8080:8080 ${GITHUB_LOGIN}/searxngshould start as many workers as number of CPU cores (same as the current master branch).docker run --rm -ti -p 8080:8080 -e UWSGI_WORKERS=1 ${GITHUB_LOGIN}/searxngshould start one worker.Author's checklist
Related issues