Skip to content

Commit

Permalink
Refs #33974 - 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 16, 2024
1 parent e6e1ea7 commit f5a94e8
Show file tree
Hide file tree
Showing 2 changed files with 7 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, 5].max
end
3 changes: 3 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,3 @@
if answers['foreman'].is_a?(Hash) && answers.dig('foreman', 'db_pool').to_i == 5
answers['foreman']['db_pool'] = nil
end

0 comments on commit f5a94e8

Please sign in to comment.