We use GitHub Actions to manage the CI of our Phoenix
It’s all fine and all, but sometimes, randomly, the deploy process runs into this error toward the end:
FATAL 53300 (too_many_connections) remaining connection slots are reserved for non-replication superuser connections
I cannot find anything related in Fly documentation. I tried to connect to our prod DB (
SELECT usename, application_name, state, query FROM pg_stat_activity;), and it seemed that a lot of PG connexions were taken already: 5 from
cloudsqladmin, and 25 from
postgres. Most of these connexions are idle, though. Besides, that number is much higher than
pool_size in our
runtime.exs config file, which is set at 10.
So my questions:
- Has anyone encountered the same problem? Might it be GitHub-related?
pool_sizeand the max number of PG connexions related? If not, is there a place to configure it?
- Should we use a Postgres cluster for our DB? I am looking for the pros and cons of using Fly’s native PG cluster but I can’t find anything convincing…