20680: Set concurrency to num_cpus * 2 with a minimum of 8 20680-cores-concurrency
authorPeter Amstutz <peter.amstutz@curii.com>
Mon, 14 Aug 2023 18:41:39 +0000 (14:41 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 14 Aug 2023 18:41:39 +0000 (14:41 -0400)
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 <peter.amstutz@curii.com>

tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls
tools/salt-install/config_examples/multi_host/aws/pillars/nginx_passenger.sls

index 58a7851c28a7ea2c9da1d6112816dcea85240bd0..301790088071718979ecba2ec4e7cb8c2068d658 100644 (file)
@@ -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.
index ce8f0ff407a2a5819d98f27c1b238291df5be578..4c0aea25fe7ada8c6b9cf0f0853df8f56fdd2f52 100644 (file)
@@ -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