diff --git a/src/bosh-director/bin/bosh-director b/src/bosh-director/bin/bosh-director index 5336ba1fdff..5b73d04ad7c 100755 --- a/src/bosh-director/bin/bosh-director +++ b/src/bosh-director/bin/bosh-director @@ -33,6 +33,8 @@ puma_configuration = Puma::Configuration.new do |user_config| user_config.port config.port user_config.app rack_app user_config.preload_app! + # this makes sure that all puma workers get their own db connections + user_config.before_fork { Bosh::Director::Config.db.disconnect } end puma_launcher = Puma::Launcher.new(puma_configuration) diff --git a/src/bosh-director/lib/bosh/director/config.rb b/src/bosh-director/lib/bosh/director/config.rb index fb02dd329b4..27039dc9fa6 100644 --- a/src/bosh-director/lib/bosh/director/config.rb +++ b/src/bosh-director/lib/bosh/director/config.rb @@ -270,6 +270,7 @@ def configure_db(db_config) if logger db.logger = logger db.sql_log_level = :debug + db.log_connection_info = true end db