FEATURE: Bump and allow customization of nginx worker_processes
authorRafael dos Santos Silva <xfalcox@gmail.com>
Thu, 17 Feb 2022 19:54:08 +0000 (16:54 -0300)
committerRafael dos Santos Silva <xfalcox@gmail.com>
Fri, 18 Feb 2022 17:11:57 +0000 (14:11 -0300)
MessageBus connections on busy sites can easily use more than the max
default number of connections.

Refer to http://nginx.org/en/docs/ngx_core_module.html#worker_connections

templates/web.template.yml

index e4bd8a4cbbf9bb75140624305cbda171b19995e8..cdfc16fd23bce8502ed68b7f576060024633651e 100644 (file)
@@ -21,6 +21,7 @@ params:
 
   home: /var/www/discourse
   upload_size: 10m
+  nginx_worker_connections: 4000
 
 run:
   - exec: thpoff echo "thpoff is installed!"
@@ -135,6 +136,11 @@ run:
       from: /client_max_body_size.+$/
       to: client_max_body_size $upload_size ;
 
+  - replace:
+      filename: "/etc/nginx/conf.d/discourse.conf"
+      from: /worker_connections.+$/
+      to: worker_connections $nginx_worker_connections ;
+
   - exec:
       cmd: echo "done configuring web"
       hook: web_config