Skip to content

Commit 688685d

Browse files
committed
[ruby/grape] Let Puma decide the number of workers
1 parent ea7463a commit 688685d

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
@@ -14,5 +14,6 @@ WORKDIR /grape
1414
RUN bundle install --jobs=4 --gemfile=/grape/Gemfile
1515

1616
EXPOSE 8080
17+
ENV WEB_CONCURRENCY=auto
1718

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

0 commit comments

Comments
 (0)