make template smart enough to enable brotli if needed
[discourse_docker.git] / templates / web.template.yml
index f174568120eba9d92b7156f3d8885ac14bada055..d355a49aa637eaa34b9e72291e145ba913ff39bf 100644 (file)
@@ -3,10 +3,9 @@ env:
   RAILS_ENV: 'production'
   UNICORN_WORKERS: 3
   UNICORN_SIDEKIQS: 1
-  # slightly less aggressive than "recommendation" but works fine with oobgc
-  RUBY_GC_MALLOC_LIMIT: 40000000
-  # this ensures we have enough heap space to handle a big pile of small reqs
-  RUBY_GC_HEAP_INIT_SLOTS: 800000
+  # this gives us very good cache coverage, 96 -> 99
+  # in practice it is 1-2% perf improvement
+  RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072
 
   DISCOURSE_DB_SOCKET: /var/run/postgresql
   DISCOURSE_DB_HOST:
@@ -119,6 +118,7 @@ run:
         - "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf"
         - "rm /etc/nginx/sites-enabled/default"
         - "mkdir -p /var/nginx/cache"
+        - '[ ! -z "$COMPRESS_BROTLI"] && sed -i "s/# brotli/brotli/" /etc/nginx/conf.d/discourse.conf'
 
   - replace:
       filename: /etc/nginx/nginx.conf