Skip to content

Commit 954da00

Browse files
authored
[ruby/rack-sequel] Set puma workers to 1.25 * nproc (#10443)
WEB_CONCURRENCY=auto sets the number of workers to the number of processors. Setting it to 1.25 the number of processors seems to perform better.
1 parent 3a24309 commit 954da00

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
1616

1717
ENV DBTYPE=postgresql
1818

19-
ENV WEB_CONCURRENCY=auto
2019
ENV MAX_THREADS=5
2120

2221
EXPOSE 8080
2322

24-
CMD bundle exec puma -C config/puma.rb -b tcp://0.0.0.0:8080 -e production
23+
CMD export WEB_CONCURRENCY=$(($(nproc)*5/4)) && \
24+
bundle exec puma -C config/puma.rb -b tcp://0.0.0.0:8080 -e production

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile
1616

1717
ENV DBTYPE=mysql
1818

19-
ENV WEB_CONCURRENCY=auto
2019
ENV MAX_THREADS=5
2120

2221
EXPOSE 8080
2322

24-
CMD bundle exec puma -C config/puma.rb -b tcp://0.0.0.0:8080 -e production
23+
CMD export WEB_CONCURRENCY=$(($(nproc)*5/4)) && \
24+
bundle exec puma -C config/puma.rb -b tcp://0.0.0.0:8080 -e production

0 commit comments

Comments
 (0)