If you encounter the following issue:
org.postgresql.util.PSQLException: FATAL: remaining connection slots are reserved for non-replication superuser connections
Cause: Each VMware Cloud Director Object Storage Extension server node requires 90 database connections. The total required database connection count is 90 multiplied by the VMware Cloud Director Object Storage Extension server node count. Considering a multi-node deployment, set a large max_connection
count in your PostgreSQL server.
show max_connections;
# Check Max Connection Limit (100 by default)
postgres=# show max_connections;
max_connections
-----------------
100
(1 row)
Show shared_buffers;
# Check Buffer Size (128MB by default)
postgres=# Show shared_buffers;
shared_buffers
----------------
128MB
(1 row)
ALTER SYSTEM SET max_connections TO '200';
# Change the Max Connections
postgres=# ALTER SYSTEM SET max_connections TO '200';
ALTER SYSTEM
# Change the buffer size (default 128MB – optional for testing)
ALTER SYSTEM SET shared_buffers TO '256MB';
systemctl restart postgresql
SELECT datname, numbackends FROM pg_stat_database;
# Check Connections
postgres=# SELECT datname, numbackends FROM pg_stat_database;
datname | numbackends
-----------+-------------
| 0
postgres | 1
template1 | 0
template0 | 0
osedb | 95 <-----
osedb2 | 95 <-----
(6 rows)
Show shared_buffers;
# Check Buffer
postgres=# Show shared_buffers;
shared_buffers
----------------
256MB <-----
(1 row)