[MacPorts] #60662: psql: FATAL: remaining connection slots are reserved for non-replication superuser connections
MacPorts
noreply at macports.org
Thu Jun 18 01:24:31 UTC 2020
#60662: psql: FATAL: remaining connection slots are reserved for non-replication
superuser connections
-----------------------------+---------------------
Reporter: ryandesign | Owner: admin@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: server/hosting | Version:
Resolution: | Keywords:
Port: |
-----------------------------+---------------------
Comment (by neverpanic):
I did some more debugging, using
{{{
sudo -u postgres psql -c "select pid, backend_start, query_start,
state_change from pg_stat_activity where usename = 'trac' order by pid
asc, state_change asc;" | cat
}}}
which gives me a list of currently open connections and their last state
change. This shows that most of the connections are actually getting used
regularly, and Trac just keeps them open in its connection pool for the
next client. I think I now know what was happening here:
- We started 14 worker processes.
- Each of these 14 workers created up to 10 database connections in its
connection pool (see
https://trac.edgewall.org/browser/tags/trac-1.2.5/trac/db/pool.py#L203)
- Our database only accepts 100 connections per user
I have now specified a connection pool size of 6 connections per server
instance and increased the worker count to 15. That should give us 90
database connections at most and leave some room for cronjobs.
--
Ticket URL: <https://trac.macports.org/ticket/60662#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list