PG 53300 error "remaining connection slots reserved" randomly appearing at deploy

@fdeage that errors seems to pretty clearly indicate that the deploy process is unable to get a Postgres connection to do the migrations with — don’t think it’s related in any way to Github Actions.

If you already have a large number of connections open, you’d want to see where they’re open and why, in the application itself.

pool_size would be the number of connections each VMs takes out, so you’d expect to have that multiplied by the number of instances you’re running as the baseline connection count.

There’s a lot of information here: How to setup and use PGBouncer with Fly Postgres — most of it is about pgBouncer, but the same details apply whether you decide to use a bouncer or not.

2 Likes