Skip to content

Commit 783108d

Browse files
authored
Merge pull request rails#53535 from codergeek121/adapt-rails-web-concurrency-documentation-for-auto
Change the WEB_CONCURRENCY deploy comment default to `auto`
2 parents a0475d3 + 7e29fd6 commit 783108d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

guides/source/tuning_performance_for_deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ or if the server is running multiple applications, to how many cores you want th
122122
If you only use one thread per worker, then you can increase it to above one per process to account for when workers are
123123
idle waiting for I/O operations.
124124

125-
You can configure number of Puma workers by setting the `WEB_CONCURRENCY` environment variable.
125+
You can configure the number of Puma workers by setting the `WEB_CONCURRENCY` environment variable. Setting `WEB_CONCURRENCY=auto` will automatically adjust the Puma worker count to match the number of available CPUs. However, this setting might be inaccurate on cloud hosts with shared CPUs or platforms that report CPU counts incorrectly.
126126

127127
### YJIT
128128

railties/lib/rails/generators/rails/app/templates/config/deploy.yml.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ env:
3838
<% if skip_solid? -%>
3939
# clear:
4040
# # Set number of cores available to the application on each server (default: 1).
41-
# WEB_CONCURRENCY: 2
41+
# WEB_CONCURRENCY: auto
4242

4343
# # Match this to any external database server to configure Active Record correctly
4444
# DB_HOST: 192.168.0.2

railties/lib/rails/generators/rails/app/templates/config/puma.rb.tt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
#
88
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
99
# should only set this value when you want to run 2 or more workers. The
10-
# default is already 1.
10+
# default is already 1. You can set it to `auto` to automatically start a worker
11+
# for each available processor.
1112
#
1213
# The ideal number of threads per worker depends both on how much time the
1314
# application spends waiting for IO operations and on how much you wish to

0 commit comments

Comments
 (0)