[arvados] created: 2.6.0-205-gb859429b4

git repository hosting git at public.arvados.org
Fri May 26 19:22:53 UTC 2023


        at  b859429b4a76996d7807caa79f4995458703238d (commit)


commit b859429b4a76996d7807caa79f4995458703238d
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Fri May 26 15:45:31 2023 -0300

    20595: Scales nginx settings depending on max concurrent requests config.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

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 7bbf9ae61..b00317233 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,6 +12,7 @@
 {%- 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_reqs = "__CONTROLLER_MAX_CONCURRENT_REQUESTS__" %}
 
 ### NGINX
 nginx:
@@ -22,11 +23,10 @@ nginx:
   passenger:
     passenger_ruby: {{ passenger_ruby }}
     passenger_max_pool_size: {{ "__CONTROLLER_NGINX_WORKERS__" or grains['num_cpus'] }}
-    {%- set max_reqs = "__CONTROLLER_MAX_CONCURRENT_REQUESTS__" %}
-    {%- if max_reqs != "" and max_reqs is number %}
+    {%- if max_reqs != "" %}
     # Default is 100 -- Configuring this a bit higher than API.MaxConcurrentRequests
     # to be able to handle /metrics requests even on heavy load situations.
-    passenger_max_request_queue_size: {{ (max_reqs * 1.1)|round|int }}
+    passenger_max_request_queue_size: {{ (max_reqs|int * 1.1)|round|int }}
     {%- endif %}
 
   ### SERVER
@@ -44,9 +44,15 @@ nginx:
       load_module: {{ passenger_mod }}
       {% endif %}
       worker_processes: {{ "__CONTROLLER_NGINX_WORKERS__" or grains['num_cpus'] }}
+      {%- if max_reqs != "" %}
+      worker_rlimit_nofile: {{ (max_reqs|int * 3)|round|int }}
+      events:
+        worker_connections: {{ (max_reqs|int * 3)|round|int }}
+      {%- else %}
       worker_rlimit_nofile: 4096
       events:
         worker_connections: 1024
+      {%- endif %}
 
   ### SNIPPETS
   snippets:

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list