mirror of
https://github.com/bugsink/bugsink.git
synced 2026-02-14 10:33:50 -06:00
Default worker-count in Docker: min(cpu_count, 4) instead of 1
As per discussion with @sekrause on #101 Briefly: recent reduction is a good idea, but 1 is probably too little.
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
### Backwards-incompatible changes
|
||||
|
||||
* The default number of web processes (gunicorn server workers) in the
|
||||
dockerized setup is now 1 (it used to be 10).
|
||||
dockerized setup is now equal to `min(cpu_count, 4)`; (it used to be 10).
|
||||
|
||||
set `WEB_CONCURRENCY=...` or `GUNICORN_CMD_ARGS="--workers=..."` to
|
||||
restore the previous behavior or choose a custom number.
|
||||
set `GUNICORN_CMD_ARGS="--workers=..."` to restore the previous behavior or
|
||||
choose a custom number.
|
||||
|
||||
### ...
|
||||
|
||||
|
||||
@@ -51,4 +51,4 @@ RUN ["bugsink-manage", "migrate", "snappea", "--database=snappea"]
|
||||
|
||||
HEALTHCHECK CMD python -c 'import requests; requests.get("http://localhost:8000/health/ready").raise_for_status()'
|
||||
|
||||
CMD [ "monofy", "bugsink-manage", "check", "--deploy", "--fail-level", "WARNING", "&&", "bugsink-manage", "migrate", "&&", "bugsink-manage", "prestart", "&&", "gunicorn", "--bind=0.0.0.0:$PORT", "--access-logfile", "-", "bugsink.wsgi", "|||", "bugsink-runsnappea"]
|
||||
CMD [ "monofy", "bugsink-manage", "check", "--deploy", "--fail-level", "WARNING", "&&", "bugsink-manage", "migrate", "&&", "bugsink-manage", "prestart", "&&", "gunicorn", "--config", "gunicorn.docker.conf.py", "--bind=0.0.0.0:$PORT", "--access-logfile", "-", "bugsink.wsgi", "|||", "bugsink-runsnappea"]
|
||||
|
||||
@@ -71,9 +71,10 @@ RUN --mount=type=cache,target=/var/cache/buildkit/pip \
|
||||
pip install /wheels/$WHEEL_FILE
|
||||
|
||||
COPY bugsink/conf_templates/docker.py.template bugsink_conf.py
|
||||
COPY gunicorn.docker.conf.py /app/
|
||||
|
||||
RUN ["bugsink-manage", "migrate", "snappea", "--database=snappea"]
|
||||
|
||||
HEALTHCHECK CMD python -c 'import requests; requests.get("http://localhost:8000/health/ready").raise_for_status()'
|
||||
|
||||
CMD [ "monofy", "bugsink-manage", "check", "--deploy", "--fail-level", "WARNING", "&&", "bugsink-manage", "migrate", "&&", "bugsink-manage", "prestart", "&&", "gunicorn", "--bind=0.0.0.0:$PORT", "--access-logfile", "-", "bugsink.wsgi", "|||", "bugsink-runsnappea"]
|
||||
CMD [ "monofy", "bugsink-manage", "check", "--deploy", "--fail-level", "WARNING", "&&", "bugsink-manage", "migrate", "&&", "bugsink-manage", "prestart", "&&", "gunicorn", "--config", "gunicorn.docker.conf.py", "--bind=0.0.0.0:$PORT", "--access-logfile", "-", "bugsink.wsgi", "|||", "bugsink-runsnappea"]
|
||||
|
||||
4
gunicorn.docker.conf.py
Normal file
4
gunicorn.docker.conf.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# gunicorn config file for Docker deployments
|
||||
import multiprocessing
|
||||
|
||||
workers = min(multiprocessing.cpu_count(), 4)
|
||||
Reference in New Issue
Block a user