Connection to AWS PostgreSQL Dropped After 20 Minutes of Inactivity

We are experiencing consistent connection timeouts between our Retool Hosted instance and our AWS PostgreSQL database. The connection appears to be dropped after approximately 20 minutes of inactivity. We then have to go to Resources in Retool and manually run 'Test connection' twice (with about a 4-minute wait in between) to re-establish the connection. Our PostgreSQL idle_session_timeout is set to '0', and idle_in_transaction_session_timeout is '1d', so the timeouts are not originating from the database itself. We suspect an idle connection timeout might be occurring somewhere in the network path...?

  • Retool IPs available in Inbound Rules

Troubleshoot resource connections

Hi @Rob_Merks, welcome to the Retool Community Forum! I have a feeling that the dropped idle connections is something that AWS could be doing automatically, based on this blog post. I'm thinking the keepalives_idle parameter could help here in preventing an idle connection, rather than manually testing the connection from retool.

If that doesn't work, if you send me a general time period that your database drops are happening then I could check our logs and see if there's anything on our end that might help.