فهرست منبع

[ruby/grape] Let Puma decide the number of workers (#10118)

Petrik de Heus 2 روز پیش
والد
کامیت
419e62517d
2فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 2 4
      frameworks/Ruby/grape/config/puma.rb
  2. 1 0
      frameworks/Ruby/grape/grape.dockerfile

+ 2 - 4
frameworks/Ruby/grape/config/puma.rb

@@ -1,11 +1,9 @@
 require_relative 'auto_tune'
 
 # FWBM only... use the puma_auto_tune gem in production!
-num_workers, num_threads = auto_tune
+_, num_threads = auto_tune
 
-workers num_workers
-
-threads 3, 3
+threads num_threads
 
 # Use the `preload_app!` method when specifying a `workers` number.
 # This directive tells Puma to first boot the application and load code

+ 1 - 0
frameworks/Ruby/grape/grape.dockerfile

@@ -13,6 +13,7 @@ WORKDIR /grape
 
 RUN bundle install --jobs=4 --gemfile=/grape/Gemfile
 
+ENV WEB_CONCURRENCY=auto
 EXPOSE 8080
 
 CMD bundle exec puma -C config/puma.rb -b tcp://0.0.0.0:8080 -e production