Skip to content

Commit 8130a9f

Browse files
authored
[ruby/rack-sequel] Let Puma decide the number of workers (#10121)
1 parent 403b0f6 commit 8130a9f

File tree

5 files changed

+6
-2
lines changed

5 files changed

+6
-2
lines changed

frameworks/Ruby/rack-sequel/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
33
gem 'json', '~> 2.8'
44
gem 'sequel', '~> 5.0'
55
gem 'rack', '~> 3.1'
6+
gem "concurrent-ruby"
67

78
group :mysql, optional: true do
89
gem 'trilogy', '~> 2.9', platforms: [:ruby, :windows]

frameworks/Ruby/rack-sequel/Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
bigdecimal (3.1.9)
5+
concurrent-ruby (1.3.5)
56
json (2.13.2)
67
nio4r (2.7.4)
78
pg (1.5.9)
@@ -21,6 +22,7 @@ PLATFORMS
2122
x86_64-linux
2223

2324
DEPENDENCIES
25+
concurrent-ruby
2426
json (~> 2.8)
2527
pg (~> 1.5)
2628
puma (~> 7.0)

frameworks/Ruby/rack-sequel/config/mri_puma.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
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
76
threads num_threads, num_threads
87

98
before_fork do

frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
1616

1717
ENV DBTYPE=postgresql
1818

19+
ENV WEB_CONCURRENCY=auto
1920
EXPOSE 8080
2021

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

frameworks/Ruby/rack-sequel/rack-sequel.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
1616

1717
ENV DBTYPE=mysql
1818

19+
ENV WEB_CONCURRENCY=auto
1920
EXPOSE 8080
2021

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

0 commit comments

Comments
 (0)