N
Neon2y ago
rival-black

How does connection limit works on the serverless driver?

hello, I am wondering when using the neon serverless driver, does it share the same connection limit with the "default connection limit", or Neon has an additional layer of pooling on top of it to automatically handle it?
3 Replies
fascinating-indigo
fascinating-indigo2y ago
.I do not believe that the serverless driver has pooling. It uses HTTP underneath
unwilling-turquoise
unwilling-turquoise2y ago
i think it depends on the connection URL you have provided to the driver. if it's with -pooler in the URL, then no connection limit.
conscious-sapphire
conscious-sapphire2y ago
^ and the pooled endpoint has the following settings:
[pgbouncer]
pool_mode=transaction
max_client_conn=10000
default_pool_size=64
max_prepared_statements=0
query_wait_timeout=120
[pgbouncer]
pool_mode=transaction
max_client_conn=10000
default_pool_size=64
max_prepared_statements=0
query_wait_timeout=120
So while the max connections is 10k, it's still possible to cap out a single user as default_pool_size will limit to 64 connections per user per database. Bear in mind that max_connections is set by your minimum CU size (or base size if you are not scaling). For example a .25CU will have 100 max connections, which you can cap out with 2 accounts through the pooler. It's ~100 per GB of RAM. So, if you want to burst a bunch of connections: * Set your base size appropriately * Use multiple accounts with the pooler.

Did you find this page helpful?