Hey team happy new year πŸŽ‰ I'm trying to figure out the optimal configuration for my worker using

Hey team happy new year πŸŽ‰

I'm trying to figure out the optimal configuration for my worker using postgres.js, Hyperdrive and Supabase.
  • The first question I have is, what would be the ideal app side connection pool value https://github.com/porsager/postgres?tab=readme-ov-file#the-connection-pool ? ofc it depends on the application but if there's not much concurrent DB queries, I'm guessing the lower the better ? (default is 10 btw)
  • Regarding the connection string for Hyperdrive, should I use the direct DB connection string to the Postgres instance (current instance provides us 380 max direct client connections and we have 2 Hyperdrive instances connecting to it, one read only with cache and the other for writes and reads without cache). Would that be enough and how could we estimate the maximum client connections when using Hyperdrive ?
  • Supabase also offers a connection pooler (Supavisor), is there any drawback of using Hypderdrive in combination with Supavisor (1,500 connections included in our current plan). However when using Supavisor in transaction mode (port 6543) we must disable prepared statements and I think that session mode isn't advised in Serverless environments. What would be your suggestion here if applicable ?
We have quite a lot of traffic on our API and we also have special community events that trigger traffic spikes in short periods, eg 1M+ users running multiple requests at the same time. I'm currently doing some load testing which should help me to find the sweat spot but would appreciate your opinion. Thanks in advance.
GitHub
Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare - porsager/postgres
Was this page helpful?