N
Neon14mo ago
rising-crimson

Hi, I use postgres. I connected and have

Hi, I use postgres. I connected and have error: ERROR: remaining connection slots are reserved for roles with the SUPERUSER attribute. Please help me
6 Replies
harsh-harlequin
harsh-harlequin14mo ago
Hey! This error typically means that you ran out of database connections. This fix is often to use the pooled connection string Do you mind sharing more details about your setup? How are you connecting to your database?
foreign-sapphire
foreign-sapphire14mo ago
Hi @Mahmoud , I'd like to ask about this as well. Why is there a separate connection string for connection pooling? Shouldn't the pool string work by default? Also any idea about the max pool settings that you have from your end - or we should configure them ourselves? I guess there would be still some limits to that.
harsh-harlequin
harsh-harlequin14mo ago
So depending on how you're deploying your app, you will need to use either the pooled connection or the direct one. In general, use pooled connections whenever you can Pooled connections can efficiently manage high numbers of concurrent client connections, up to 10,000. This 10K ceiling works best for serverless applications and application-side connection pools that have many open connections, but infrequent and/or short transactions. Use direct (unpooled) connections if you need persistent connections If your application is focused mainly on tasks like migrations or administrative operations that require stable and long-lived connections, use an unpooled connection. However, note that connection pooling is not a magic bullet. PgBouncer can keep many application connections open (up to 10,000) concurrently, but only a limited number of these can be actively querying the Postgres server at any given time: 64 active backend connections (transactions between PgBouncer and Postgres) per user-database pair, as determined by the PgBouncer's default_pool_size setting. For example, the Postgres user alex can hold up to 64 connections to a single database at one time. If you need more than 64 connections this can be increased
foreign-sapphire
foreign-sapphire14mo ago
Hi @Mahmoud , thanks for your detailed response! I understand now the reason of having both of them, seems valid. For an API backend I guess the pooled connection is the way to go. I think these default settings are more than enough for now, but thanks for the flexibility! I like this service and I'd like to build all my future projects on this one. The predictable pricing together with the separation of storage from compute (=> scale to 0) are by far some of the strongest points and I wish they will remain predictable and scalable 🙂
harsh-harlequin
harsh-harlequin14mo ago
Awesome! Feel free to reach out if you have any questions or run into any issues
foreign-sapphire
foreign-sapphire14mo ago
Thanks for the amazing and fast support, much appreciated! 🙏

Did you find this page helpful?