From 881c6b774b036d82aef3d2df822c8a2b3ff4c3df Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 14 Aug 2023 14:41:39 -0400 Subject: [PATCH] 20680: Set concurrency to num_cpus * 2 with a minimum of 8 In practice it makes sense to have two workers per core because workers usually spend at least half their time waiting on the database. Setting a minimum concurrency of 8 avoids a deadlock situation when controller calls keep-web, which calls back to controller. This doesn't completely eliminate the problem, but it at least avoids having deadlocked requests with a single user in the default configuration (!). Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../config_examples/multi_host/aws/pillars/arvados.sls | 3 ++- .../config_examples/multi_host/aws/pillars/nginx_passenger.sls | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls index 58a7851c28..3017900880 100644 --- a/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls +++ b/tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: AGPL-3.0 -{%- set max_workers = ("__CONTROLLER_MAX_WORKERS__" or grains['num_cpus'])|int %} +{%- set _workers = ("__CONTROLLER_MAX_WORKERS__" or grains['num_cpus']*2)|int %} +{%- set max_workers = [_workers, 8]|max %} {%- set max_reqs = ("__CONTROLLER_MAX_QUEUED_REQUESTS__" or 128)|int %} # The variables commented out are the default values that the formula uses. diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls index ce8f0ff407..4c0aea25fe 100644 --- a/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls +++ b/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls @@ -12,7 +12,8 @@ {%- set passenger_ruby = '/usr/local/rvm/wrappers/default/ruby' if grains.osfinger in ('CentOS Linux-7', 'Ubuntu-18.04', 'Debian-10') else '/usr/bin/ruby' %} -{%- set max_workers = ("__CONTROLLER_MAX_WORKERS__" or grains['num_cpus'])|int %} +{%- set _workers = ("__CONTROLLER_MAX_WORKERS__" or grains['num_cpus']*2)|int %} +{%- set max_workers = [_workers, 8]|max %} {%- set max_reqs = ("__CONTROLLER_MAX_QUEUED_REQUESTS__" or 128)|int %} ### NGINX -- 2.39.5