Skip to content

Commit a587101

Browse files
authored
[ruby/rails] Use 3 threads per worker (#8668)
Using 3 threads instead of 5 seems optimal. Running this locally I got the following results: +---------------------+---------+------+-----+-----+-----+-------+--------------+ | |plaintext|update| json| db|query|fortune|weighted_score| +---------------------+---------+------+-----+-----+-----+-------+--------------+ | 2 threads per worker| 20870| 9478|66764|16220|11634| 10543| 1042| | 1 thread per worker| 20799| 9819|83123|17434|10334| 8653| 1048| | 4 threads per worker| 29257| 10051|69532|18108|11752| 11132| 1093| | 5 threads per worker| 33152| 10203|77062|18459|11721| 11711| 1114| | 3 threads per worker| 25077| 10382|84429|16497|12338| 11246| 1141| +---------------------+---------+------+-----+-----+-----+-------+--------------+
1 parent 16485af commit a587101

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

frameworks/Ruby/rails/config/database.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default: &default
55
password: benchmarkdbpass
66
host: tfb-database
77
timeout: 5000
8-
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
8+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 3 } %>
99

1010
development:
1111
<<: *default

frameworks/Ruby/rails/config/puma.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# the maximum value specified for Puma. Default is set to 5 threads for minimum
1010
# and maximum; this matches the default thread size of Active Record.
1111
#
12-
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
12+
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 3 }
1313
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
1414
threads min_threads_count, max_threads_count
1515

0 commit comments

Comments
 (0)