21285: Adds MaxGatewayTunnels' value to nginx's request queue size.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 9 Jan 2024 17:35:53 +0000 (14:35 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 9 Jan 2024 17:37:08 +0000 (14:37 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

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

index a3a3d405f1de5bd2ac4600989d1f8325ce10ea9d..25027b85716b6049c2c30d735529da261d51c67b 100644 (file)
@@ -9,21 +9,16 @@
 {%- set controller_nr = balancer_backends|length %}
 {%- set disabled_controller = "__DISABLED_CONTROLLER__" %}
 {%- set max_reqs = ("__CONTROLLER_MAX_QUEUED_REQUESTS__" or 128)|int %}
+{%- set max_tunnels = ("__CONTROLLER_MAX_GATEWAY_TUNNELS__" or 1000)|int %}
 
 ### NGINX
 nginx:
   ### SERVER
   server:
     config:
-      {%- if max_reqs != "" %}
-      worker_rlimit_nofile: {{ (max_reqs|int * 3 * controller_nr)|round|int }}
+      worker_rlimit_nofile: {{ (max_reqs * 3 + max_tunnels) * controller_nr }}
       events:
-        worker_connections: {{ (max_reqs|int * 3 * controller_nr)|round|int }}
-      {%- else %}
-      worker_rlimit_nofile: 4096
-      events:
-        worker_connections: 1024
-      {%- endif %}
+        worker_connections: {{ (max_reqs * 3 + max_tunnels) * controller_nr }}
       ### STREAMS
       http:
         'geo $external_client':
index 82f1b91bb5ba4efb997f9f7da2c14b4a58f13e81..0655a0db1f4ec382fdcc917202b6a634c1ed06b5 100644 (file)
@@ -15,6 +15,7 @@
 {%- 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 %}
+{%- set max_tunnels = ("__CONTROLLER_MAX_GATEWAY_TUNNELS__" or 1000)|int %}
 
 ### NGINX
 nginx:
@@ -50,13 +51,13 @@ nginx:
       {% endif %}
       worker_processes: {{ max_workers }}
 
-      # each request is up to 3 connections (1 with client, 1 proxy to
+      # Each client request is up to 3 connections (1 with client, 1 proxy to
       # controller, then potentially 1 from controller back to
       # passenger).  Each connection consumes a file descriptor.
       # That's how we get these calculations
-      worker_rlimit_nofile: {{ max_reqs * 3 + 1 }}
+      worker_rlimit_nofile: {{ max_reqs * 3 + 1 + max_tunnels }}
       events:
-        worker_connections: {{ max_reqs * 3 + 1 }}
+        worker_connections: {{ max_reqs * 3 + 1 + max_tunnels }}
 
   ### SITES
   servers: