theforeman / puppet-foreman

Puppet module for Foreman
GNU General Public License v3.0
104 stars 269 forks source link

Fixes #33974 - Change the pool size to threads + 4 #1161

Closed ShimShtein closed 4 months ago

ShimShtein commented 4 months ago

According to an investigation described in https://community.theforeman.org/t/rails-connection-pool-size-optimizations/36675 foreman process spawns 4 additional threads that consume DB connection during the startup. Hence the amount of acctive DB connections should be the amount of puma threads + 4 additional threads.

ShimShtein commented 4 months ago

@pablomh Thanks for all the testing and experimenting. What do you think, is it enough?

pablomh commented 4 months ago

Hi @ShimShtein, according to our data, this change should be very welcome :)

These are the results of our testing that justify this change:

image

image

image

Based on this testing, we agree that the minimum Foreman DB pool value where all these issues are addressed is 9.

ehelms commented 4 months ago

@ShimShtein This will reset the default value, to really fix this we need to also reset this in the installer through a migration.

ShimShtein commented 4 months ago

@ehelms Added a migration PR: https://github.com/theforeman/foreman-installer/pull/937

ShimShtein commented 4 months ago

@ekohl fixed both here and the installer

ShimShtein commented 4 months ago

Should be a bit more clear now.