Max number of simultaneous connections?

Is there a maximum number of connections that Neon can support at one time?

Currently, max_connections is set to default 100 on all compute nodes. Yet, if you enable connections pooling (pgbouncer) in the project settings, the limit will be up to 1000. But keep in mind that several connections are always reserved for superusers.

max_connections is now set according to your compute size. The minimum setting is 100. Larger compute size available with the Pro plan have a higher max_connections setting, which you can read about here:

Also, connection pooling now supports up to 10,000 connections. See:

I am using Neon db in Rust using SQLX and getting prepared statement errors ““error returned from database: prepared statement "sqlx_s_26" already exists” due to the limitation mentioned in connection pooling docs " Neon uses PgBouncer in transaction mode, which does not support Postgres features such as prepared statements or [LISTEN].”

My application is deployed on AWS lambda and if lambda scales out it starts to get connection limit errors. Is there any way or plan in the future to support prepared pooling?

There is also this PR about to merge https://github.com/pgbouncer/pgbouncer/pull/845 which will support prepared statements on PgBouncer, do you think when it is merged you guys will be able to update or provide the option to turn on prepared pooling method?

This is the only reason why I am not able to utilize the full potential of powerful neon db in lambda serverless.

I appreciate the work you guys are doing to make the developer experience smooth. Thanks for that.

1 Like