diff --git a/manifests/config.pp b/manifests/config.pp index fb9953d2..aad99ac0 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -68,7 +68,8 @@ 'database' => $foreman::db_database, 'username' => $foreman::db_username, 'password' => $foreman::db_password, - 'db_pool' => max($foreman::db_pool, $foreman::foreman_service_puma_threads_max), + # Set the pool size to at least the amount of puma threads + 4 threads that are spawned automatically by the process. + 'db_pool' => max($foreman::db_pool, $foreman::foreman_service_puma_threads_max + 4), } file { '/etc/foreman/database.yml': diff --git a/manifests/init.pp b/manifests/init.pp index 08d901d3..9ca868db 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -226,7 +226,7 @@ String[1] $db_password = $foreman::params::db_password, Optional[String[1]] $db_sslmode = undef, Optional[String[1]] $db_root_cert = undef, - Integer[0] $db_pool = 5, + Integer[0] $db_pool = 9, Boolean $db_manage_rake = true, Stdlib::Port $server_port = 80, Stdlib::Port $server_ssl_port = 443, diff --git a/spec/classes/foreman_spec.rb b/spec/classes/foreman_spec.rb index df552d35..35e4a2d6 100644 --- a/spec/classes/foreman_spec.rb +++ b/spec/classes/foreman_spec.rb @@ -199,7 +199,7 @@ db_username: 'foreman', db_password: 'secret', db_sslmode: 'prefer', - db_pool: 5, + db_pool: 9, db_manage_rake: true, server_port: 80, server_ssl_port: 443,