-
Hello, I'm using postgres.js with Supavisor. My server (1 to 3 instances) is not serverless (fly.io vm). I wonder if I should set The way I understand it is that it's the Supervisor's job to manage that. Am I wrong? Thanks 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you're on Fly with a known set of nodes you may not even need the pooler. Because Fly speaks IPv6. And yes you should set the pool size for your client (or leave the default but I like to be explicit). Then you will have pool size * N nodes connected to your database. Make sure you have enough connections available with If you find you need the pooler the ideal setup is likely to use For every connection from your server it will spin up a connection to your database and hold it as long as your server has the connection to Supavisor. In this scenario you will be limited to your pool size (on the database settings page). If your app scales and you find you need more connections, just use |
Beta Was this translation helpful? Give feedback.
If you're on Fly with a known set of nodes you may not even need the pooler. Because Fly speaks IPv6.
And yes you should set the pool size for your client (or leave the default but I like to be explicit). Then you will have pool size * N nodes connected to your database. Make sure you have enough connections available with
show max_connections;
and then subtract current active connectionsselect count(*) from pg_stat_activity;
.If you find you need the pooler the ideal setup is likely to use
session
mode (pooler url on port 5432). This is pretty close just a proxy.For every connection from your server it will spin up a connection to your database and hold it as long as your server has th…