From fea44486c33fc7aee72392c2e2a6ccf29201e464 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 6 Sep 2020 22:16:12 +0200 Subject: [PATCH] docker: use static worker count for docker (2 workers + 4 threads) --- docker/gunicorn.conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/gunicorn.conf.py b/docker/gunicorn.conf.py index 5273c5278..17ea97fca 100644 --- a/docker/gunicorn.conf.py +++ b/docker/gunicorn.conf.py @@ -1,15 +1,16 @@ """Gunicorn config""" -import multiprocessing - import structlog bind = "0.0.0.0:8000" -workers = multiprocessing.cpu_count() * 2 + 1 +workers = 2 +threads = 4 user = "passbook" group = "passbook" worker_class = "uvicorn.workers.UvicornWorker" +# Docker containers don't have /tmp as tmpfs +worker_tmp_dir = "/dev/shm" logconfig_dict = { "version": 1,