Supavisor and Connection Terminology Explained

Supavisor runs the shared pooler. This article explains the connection terms that are specific to it. For general terms, such as client connections, backend connections, and max_connections, see Connection pooling and limits.

Pool size:

The number of direct connections Supavisor is permitted to request from the database to manage each user, database, and mode combination.

Transaction mode:

Transaction mode gives the pooler permission to share direct connections among multiple clients. It is used when the pooler connection string is listening on port 6543:

#example transaction mode string
postgres://postgres.obfwhevidiamwdwki:[YPASSWORD]@aws-0-ca-central-1.pooler.supabase.com:**6543**/postgres

Transaction mode lets clients use a database connection only while they run a query. This reduces the chances of hitting the maximum direct connection limit.

Session mode:

Session mode restricts the pooler, forcing it to grant an underlying direct connection exclusively to a single client connection.

#example session mode string | uses port 5432
postgres://postgres.obfwhevidiamwdwki:[YPASSWORD]@aws-0-ca-central-1.pooler.supabase.com:**5432**/postgres

Session mode behaves nearly identically to a standard direct connection. It has two benefits.

If you need long-lasting connections in an IPv4-only environment and don’t want to enable the IPv4 add-on, use session mode.

Session mode also queues clients. If all direct connections were taken, without the pooler, the next client that tried to connect would be rejected. It would have to poll the database to see if a slot became available. The pooler in session mode queues a client for up to a minute, so it doesn’t have to poll while waiting for a slot.

Go to the GitHub discussion