From 5c3bc7dee22cbe14b4668dff6645a57afa0a42f9 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Wed, 15 Apr 2026 05:38:54 +0000 Subject: [PATCH] fix(infra): cap pgsql_servers max_connections to 50 per HG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ProxySQL was configured with pgsql_servers.max_connections=500 on BOTH hostgroups (0 and 1) pointing at the same backend, implying a pool cap of 1000 connections against a PostgreSQL container that only allows 120 (117 non-super). Under test workload the non-super slots would fill up and PostgreSQL rejected new Monitor connects with: FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute This caused pgsql-monitor_ssl_connections_test-t (PHASE 1) and pgsql-servers_ssl_params-t (test 33) to fail — the SSL Monitor counter couldn't advance because the Monitor couldn't connect. PostgreSQL doesn't scale well with connection count, so lower the per-hostgroup cap to 50 (total 100 across the two HGs), leaving ample headroom under PG's max_connections=120 for monitor + superuser slots. The 500 value was templated from the MySQL/MariaDB infras during unify-PR-5433-5442, where each backend's server-side max_connections=500 matches ProxySQL's cap. PostgreSQL here is a different beast and the copy-paste didn't fit. --- test/infra/docker-pgsql16-single/conf/proxysql/config.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/infra/docker-pgsql16-single/conf/proxysql/config.sql b/test/infra/docker-pgsql16-single/conf/proxysql/config.sql index 276cbed01..bfa071521 100644 --- a/test/infra/docker-pgsql16-single/conf/proxysql/config.sql +++ b/test/infra/docker-pgsql16-single/conf/proxysql/config.sql @@ -1,6 +1,6 @@ DELETE FROM pgsql_servers; -INSERT INTO pgsql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (0,'127.0.0.1',15432,0,500,'pgsql1'); -INSERT INTO pgsql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (1,'127.0.0.1',15432,0,500,'pgsql1'); +INSERT INTO pgsql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (0,'127.0.0.1',15432,0,50,'pgsql1'); +INSERT INTO pgsql_servers (hostgroup_id,hostname,port,max_replication_lag,max_connections,comment) VALUES (1,'127.0.0.1',15432,0,50,'pgsql1'); LOAD PGSQL SERVERS TO RUNTIME; SAVE PGSQL SERVERS TO DISK;