Postgresql Bash psql -U postgres -c 'SHOW config_file' psql -U postgres -c 'SHOW config_file' psql -U postgres -c 'SHOW max_connections' `bash systemctl restart postgresql-12.service `
- Postgresql connection exceeded issue solve -
Error snapshots logs from server file = httpd-errro.log
connection = Database.connect(**conn_params) dial functioned error:: FATAL: remaining connection slots are reserved for non-replication superuser connections File "/usr/local/src/f******/f******env/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect <class 'django.db.utils.OperationalError'> dialersession.py 171 conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL: remaining connection slots are reserved for non-replication superuser connections
Check current running connection:
psql -U postgres -c 'SELECT count(*) FROM pg_stat_activity;'
Check postgresql configuration file location:
psql -U postgres -c 'SHOW config_file'
Edit postgresql.conf file and did bellow changes as required:
vim /var/lib/pgsql/12/data/postgresql.conf
max_connections = 300 # (change requires restart)
Check max_connections from psql status:
psql -U postgres -c 'SHOW max_connections'
Restart postgresql service and other services accordingly:
systemctl restart postgresql-12.service