From 29f9c0d09e84728648848eb0be67e151482d7cb2 Mon Sep 17 00:00:00 2001 From: Sebastian Jambor Date: Tue, 18 Apr 2023 22:09:59 +0200 Subject: [PATCH] increase size of connection pool --- config/database.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/database.yml b/config/database.yml index 34acf2f19..7216e44dd 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,6 +1,9 @@ default: &default adapter: postgresql - pool: <%= ENV["DB_POOL"] || ENV['MAX_THREADS'] || 5 %> + # The db pool must contain at least one more connection than the number of threads. + # Each thread uses its own connection, and we need an additional connection used + # by the ActivityLogAudienceHelper + pool: <%= ENV["DB_POOL"] || ENV.fetch('MAX_THREADS', 5).to_i + 1 %> timeout: 5000 connect_timeout: 15 encoding: unicode