N
Neon11mo ago
passive-yellow

Connection limit being reached too soon

I'm having issues with connection limit. I'm using 0.25 CU and Paid Plan. The SHOW max_connections; returns 112. I'm using pgbouncer, 3 services, each service has its own username. Sometimes I get these connections spikes of 55 connections (picture), and when this happens, no service can create more connections. I don't get it. The connection limit should be 112, not 55. Also, the connection limit for a misbehaving service should be 64, preventing it from exhausting connections for others. During these high-connections times the neon UI cannot connect to Postgres, so I cannot run select * from pg_stat_activity to debug it or so...
No description
7 Replies
exotic-emerald
exotic-emerald11mo ago
Before we get into troubleshooting these specific questions, If you are able to switch to pooled connection string, your limit should immediately bump up to 10,000 https://neon.tech/docs/connect/connection-pooling
Neon
About Connection pooling - Neon Docs
Neon uses PgBouncer to support connection pooling, enabling up to 10,000 concurrent connections. PgBouncer is a lightweight connection pooler for Postgres. How to use connection pooling To use connect...
exotic-emerald
exotic-emerald11mo ago
(we also run pgbouncer on behalf of all users as part of the platform)
passive-yellow
passive-yellowOP11mo ago
I am using only pooled connection strings
rare-sapphire
rare-sapphire11mo ago
This message makes me uneasy. Even if they are not using a connection pool, if you claim there should be 112 connections and it stops at half (55), it does not seem reliable to me. Can u explain it? 🤔
passive-yellow
passive-yellowOP11mo ago
Hi, @Patie . What can I explain? 😄 These are all my observations. When this connection spike happens 2 of my services, one JS App and one Python App, stop connecting to Neon and spam the error logs...
rare-sapphire
rare-sapphire11mo ago
@lucasavila00 it was question to neon team 🙂 I wonder why this is happening, I'm worried about it so that it doesn't happen on our a production application.
relaxed-coral
relaxed-coral11mo ago
Hey @lucasavila00 Solutions Engineer here at Neon! Happy to help troubleshoot. Can you create a support ticket here: https://console.neon.tech/app/projects?modal=support with your paid plan email? Feel free to cc me savannah@neon.tech

Did you find this page helpful?