Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: expose control over additional pooler parameters

Div Arora3dfa38854d82
diff --git a/apps/docs/pages/guides/platform/custom-postgres-config.mdx b/apps/docs/pages/guides/platform/custom-postgres-config.mdx
index be25220006c..400f5a2ee14 100644
--- a/apps/docs/pages/guides/platform/custom-postgres-config.mdx
+++ b/apps/docs/pages/guides/platform/custom-postgres-config.mdx
@@ -73,3 +73,15 @@ max_parallel_workers |3 |
export const Page = ({ children }) => <Layout meta={meta} children={children} />
export default Page
+
+## Pooler Config
+
+You can also [customize some parameters](https://app.supabase.com/project/_/settings/database) for the Connection Pooler:
+
+1. [Pooling Mode](https://devcenter.heroku.com/articles/best-practices-pgbouncer-configuration#pgbouncer-s-connection-pooling-modes)
+1. [Default Pool Size](https://www.pgbouncer.org/config.html)
+1. [Max Client Connections](https://www.pgbouncer.org/config.html)
+
+The default pool size, and the maximum number of clients allowed to connect concurrently is automatically optimized based on the compute add-on being used. At the moment, the Dashboard only reflects any custom configuration being used, and does not include the default optimized numbers used for your project.
+
+Custom Pooler Config may also require manual updates to any relevant overrides when changing compute add-ons.
diff --git a/studio/components/interfaces/Settings/Database/ConnectionPooling.tsx b/studio/components/interfaces/Settings/Database/ConnectionPooling.tsx
index 6792ab6557e..1c6add21323 100644
--- a/studio/components/interfaces/Settings/Database/ConnectionPooling.tsx
+++ b/studio/components/interfaces/Settings/Database/ConnectionPooling.tsx
@@ -105,6 +105,7 @@ interface ConfigProps {
ignore_startup_parameters: 'string'
pool_mode: string
pgbouncer_enabled: boolean
+ max_client_conn: number
}
connectionInfo: {
db_host: string
@@ -128,6 +129,7 @@ export const PgbouncerConfig: FC<ConfigProps> = ({ projectRef, bouncerInfo, conn
default_pool_size: bouncerInfo.default_pool_size || undefined,
ignore_startup_parameters: bouncerInfo.ignore_startup_parameters || '',
pgbouncer_enabled: bouncerInfo.pgbouncer_enabled,
+ max_client_conn: bouncerInfo.max_client_conn || undefined,
})
const updateConfig = async (updatedConfig: any) => {
@@ -174,6 +176,16 @@ export const PgbouncerConfig: FC<ConfigProps> = ({ projectRef, bouncerInfo, conn
type: 'string',
help: 'Defaults are either blank or "extra_float_digits"',
},
+ max_client_conn: {
+ title: 'Max Client Connections',
+ type: 'integer',
+ help: 'The maximum number of concurrent client connections allowed. Overrides default optimizations; refer to https://supabase.com/docs/guides/platform/custom-postgres-config#pooler-config',
+ },
+ default_pool_size: {
+ title: 'Default Pool Size',
+ type: 'integer',
+ help: 'The maximum number of connections made to the underlying Postgres cluster, per user+db combination. Overrides default optimizations; refer to https://supabase.com/docs/guides/platform/custom-postgres-config#pooler-config',
+ }
},
required: ['pool_mode'],
type: 'object',
@@ -182,7 +194,7 @@ export const PgbouncerConfig: FC<ConfigProps> = ({ projectRef, bouncerInfo, conn
return (
<div>
<SchemaFormPanel
- title="Connection Pooling"
+ title="Connection Pooling Custom Configuration"
schema={formSchema}
model={updates}
submitLabel="Save"
@@ -219,6 +231,10 @@ export const PgbouncerConfig: FC<ConfigProps> = ({ projectRef, bouncerInfo, conn
</div>
<Divider light />
<AutoField name="ignore_startup_parameters" />
+ <Divider light />
+ <AutoField name="max_client_conn" />
+ <Divider light />
+ <AutoField name="default_pool_size" />
</>
)}
<Divider light />