Hi @jasonyork! Since it sounds like you created your Postgres DB recently, your app has probably been configured to connect to it through Flycast (docs + recent forum posts). That is, your connections to the DB get proxied through fly-proxy
, which has a few benefits that are described in the first of the linked forum posts. However, the proxy currently has a 60-second timeout for idle TCP connections, so I think it’s pretty likely that that’s the cause. Unfortunately TCP keepalives also won’t help, since those happen at the kernel level and aren’t exposed to the proxy.
To verify whether you’re using Flycast, you can check the hostname you’re using to connect to the database (probably your DATABASE_URL
secret). A .flycast
domain name or an fdaa...
IPv6 address matching one from fly ips list
means it’s going through the proxy.
I know there’s been some work going to try to remove the 60 second timeout, while still protecting fly-proxy
from resource exhaustion. For now, if this turns out to be the issue, you can try connecting to your database instances directly instead. You can use the domain name top2.nearest.of.<your database app's name>.internal
, which will resolve to the two nearest instances of your database. (That’s what fly postgres attach
would configure before we changed over to using Flycast by default.)