Connect to Supabase properly

My app is connected to a PostgreSQL database hosted on Supabase.

I have it set up to connect to the database directly. However while programming and testing, my database keeps overflowing with connections. As far as I understand it, Appsmith is supposed to pool to only 5 connections, but right now after working in Appsmith for only about 30 minutes I have 20 connections from 3.131.104.27.

Supabase has its own connection pooler, should I be using that in addition to Appsmith’s pooler?

Hey! One of our engineers will take a look at this.

Please send us the server logs to help us investigate the issue.

You can grab the logs by running docker logs -f appsmith, or you could follow the steps from this guide on how to get the logs.

@Laguna I’m in the cloud version of Appsmith, so I don’t think anything in that guide applied.

Hello, can you try disabling this option in Supabase please and let me know if this was able to solve your problem or not?

@felix-appsmith I’m connected to the string/port above connection pooling on that window, not the one inside that settings box. (Port 5432, not 6543) which should mean I’m bypassing Supabase’s internal connection pooling

image

However I’m testing to make sure…

Disabled it and then did a bunch of navigation in edit mode of my app. Now I’m up to 25 connections from the Appsmith IP.

Hello @EricSGS, Could you please provide me with a specific query to be able to replicate this problem locally and determine the cause and a probable solution, or open a bug report?

I have a number of different queries. It looks like the problem is at any one time, Appsmith makes 5 connections (like it should) and it stays at 5 if I keep working with it. However if I let it idle long enough I think it thinks those 5 connections should close and it opens a fresh 5, but Supabase is still holding on to the first 5.

They do EVENTUALLY time out. After a weekend of not working on the project those connections are gone, but if I’m off and on the project all day it can hit my connection limit by the end of the day and I have to reboot the server.

If this isn’t a configuration error, I’ll open a bug report. I’ll also probably route Appsmith’s connection through Supabase’s in-house connection pooler and just let it manage it until this is resolved. I just usually assume I’ve done something wrong before I open a bug report.

Great, I see that you have already opened the bug report on GitHub. Let’s wait for a resolution from the team.