Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is not clear on exactly how pooling settings work #228

Open
jakeleventhal opened this issue Dec 18, 2023 · 1 comment
Open
Labels
documentation Improvements or additions to documentation

Comments

@jakeleventhal
Copy link

Improve documentation

Link

https://supabase.com/blog/supavisor-postgres-connection-pooler

Describe the problem

If an application running on Supabase with Supavisor ONLY uses serverless functions, it will have N max clients.

It isn't clear exactly how exactly each of the N max clients are taken/made available upon each action in an application.

In session mode, will a single serverless function use up 1/N clients for the entirety of its lifetime? In other words, does it use a single connection once it is invoked until it goes back to a cold state (but does not require connecting more than once for multiple queries in the same function invocation, or even for subsequent invocations)?

In transaction mode, does that mean that you effectively have a budget of N concurrent database queries, regardless of how many functions are active/invoked at any given moment? For instance, assume a serverless function that makes a single DB query then sleeps for 10m. If I invoke this function N times in parallel, does that imply that the budget of max clients is:

  1. At time of all functions making DB query → 0/N
  2. The moment all functions finish the query → N/N
  3. The entire duration of the 10m function → N/N
    If I then decide to invoke that same function N more times while the initial invocations are all sleeping for 10m, I could do so since the connection to the DB is broken the moment the query completes?

How exactly this works isn't documented clearly.

Describe the improvement

Provide more clear explanation for how each mode works for Supavisor.

@jakeleventhal jakeleventhal added the documentation Improvements or additions to documentation label Dec 18, 2023
@J0
Copy link
Contributor

J0 commented May 17, 2024

Hey @jakeleventhal,

Not sure if you managed to find an answer to the query but this guide may help clear things up: https://github.com/orgs/supabase/discussions/21566

Joel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants