diff --git a/pkg/cluster/connection_pooler.go b/pkg/cluster/connection_pooler.go index ac4ce67d8..cc1433f79 100644 --- a/pkg/cluster/connection_pooler.go +++ b/pkg/cluster/connection_pooler.go @@ -216,7 +216,11 @@ func (c *Cluster) getConnectionPoolerEnvVars() []v1.EnvVar { maxDBConn := *effectiveMaxDBConn / *numberOfInstances - defaultSize := maxDBConn / 2 + // Following pooler parameters are per pool, which means they have to be + // calculated from the global max db connections adjusted by the number of + // pairs (database, user). + numberOfPools := int32(len(spec.Users) * len(spec.Databases)) + defaultSize := (maxDBConn / numberOfPools) / 2 minSize := defaultSize / 2 reserveSize := minSize