Skip to content

Commit

Permalink
Update the db_pool value
Browse files Browse the repository at this point in the history
The new value should be at least the number of puma threads + 4.
More details: https://community.theforeman.org/t/rails-connection-pool-size-optimizations/36675
  • Loading branch information
ShimShtein committed May 6, 2024
1 parent e6e1ea7 commit 1a3e0cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if answers['foreman'].is_a?(Hash) && answers.dig('foreman', 'db_pool')
puma_threads_max = answers.dig('foreman', 'foreman_service_puma_threads_max').to_i
answers['foreman']['db_pool'] = [answers.dig('foreman', 'db_pool').to_i, puma_threads_max + 4].max
end
4 changes: 4 additions & 0 deletions config/katello.migrations/240506081834-change-db-pool-size.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if answers['foreman'].is_a?(Hash) && answers.dig('foreman', 'db_pool')
puma_threads_max = answers.dig('foreman', 'foreman_service_puma_threads_max').to_i
answers['foreman']['db_pool'] = [answers.dig('foreman', 'db_pool').to_i, puma_threads_max + 4].max
end

0 comments on commit 1a3e0cf

Please sign in to comment.