lifecycle: decrease default worker count on compose

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-04 21:37:13 +02:00
parent aa4f7fb2b6
commit 66bb68a747
1 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,8 @@ logconfig_dict = {
if SERVICE_HOST_ENV_NAME in os.environ:
workers = 2
else:
workers = int(os.environ.get("WORKERS", cpu_count() * 2 + 1))
default_workers = max(cpu_count() * 0.25, 1) + 1 # Minimum of 2 workers
workers = int(os.environ.get("WORKERS", default_workers))
threads = 4
warnings.simplefilter("once")