Skip to content

Commit 419e625

Browse files
authored
[ruby/grape] Let Puma decide the number of workers (#10118)
1 parent 9c1868e commit 419e625

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

frameworks/Ruby/grape/config/puma.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
require_relative 'auto_tune'
22

33
# FWBM only... use the puma_auto_tune gem in production!
4-
num_workers, num_threads = auto_tune
4+
_, num_threads = auto_tune
55

6-
workers num_workers
7-
8-
threads 3, 3
6+
threads num_threads
97

108
# Use the `preload_app!` method when specifying a `workers` number.
119
# This directive tells Puma to first boot the application and load code

frameworks/Ruby/grape/grape.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ WORKDIR /grape
1313

1414
RUN bundle install --jobs=4 --gemfile=/grape/Gemfile
1515

16+
ENV WEB_CONCURRENCY=auto
1617
EXPOSE 8080
1718

1819
CMD bundle exec puma -C config/puma.rb -b tcp://0.0.0.0:8080 -e production

0 commit comments

Comments
 (0)