© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
3 replies
gj1372

"Max client connections reached" on Transaction Pooler

Problem


How I Got Here

I am trying to connect a backend service to Supabase's database. Originally I was not having issues, but then it started reaching the maximum client connections on Supabase and therefore losing connection (?) and crashing. The service needs a constant connection to the database to continue running so it is easy to tell when something has gone wrong as the whole service stops. Around the time it started having issues, nothing was changed with the database settings nor the service code. It has been like this for around a day so far, after being fine for a couple weeks at least.

What Does Not Work (Worked Previously)

- Connecting to Supabase database transaction pooler via Java service
- Connecting to Supabase database transaction pooler via command prompt (
psql postgresql://postgres.xxxxxxxxxxxxx:xxxxxxxxxxxxxxxx@aws-1-us-east-2.pooler.supabase.com:6543/postgres
psql postgresql://postgres.xxxxxxxxxxxxx:xxxxxxxxxxxxxxxx@aws-1-us-east-2.pooler.supabase.com:6543/postgres
) with service suspended, so no other users

What Does Work

- Connecting to Supabase auth
- "Table Editor", "SQL Editor" via browser
- Connecting to Supabase database session pooler via command prompt

Environment

- Supabase: Nano, us-east-2, default if not higher pool size
- Service: Java + Spring Boot + JDBC, server is IPv4 only
- Environment variables below (no other database-related environment variables):
SPRING_DATASOURCE_URL=jdbc:postgresql://aws-1-us-east-2.pooler.supabase.com:6543/postgres?sslmode=require&ssl=true&preparedStatementCacheQueries=0&prepareThreshold=0 // if transaction pooler
SPRING_DATASOURCE_URL=jdbc:postgresql://aws-1-us-east-2.pooler.supabase.com:5432/postgres?sslmode=require&ssl=true // if session pooler
SPRING_DATASOURCE_USERNAME=postgres.XXXXXXXXX
SPRING_DATASOURCE_PASSWORD=XXXXXXXXX
SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=3
SPRING_DATASOURCE_HIKARI_MINIMUM_IDLE=1
SPRING_DATASOURCE_HIKARI_KEEPALIVE_TIME=30000
SPRING_DATASOURCE_HIKARI_CONNECTION_TIMEOUT=30000
SPRING_DATASOURCE_URL=jdbc:postgresql://aws-1-us-east-2.pooler.supabase.com:6543/postgres?sslmode=require&ssl=true&preparedStatementCacheQueries=0&prepareThreshold=0 // if transaction pooler
SPRING_DATASOURCE_URL=jdbc:postgresql://aws-1-us-east-2.pooler.supabase.com:5432/postgres?sslmode=require&ssl=true // if session pooler
SPRING_DATASOURCE_USERNAME=postgres.XXXXXXXXX
SPRING_DATASOURCE_PASSWORD=XXXXXXXXX
SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=3
SPRING_DATASOURCE_HIKARI_MINIMUM_IDLE=1
SPRING_DATASOURCE_HIKARI_KEEPALIVE_TIME=30000
SPRING_DATASOURCE_HIKARI_CONNECTION_TIMEOUT=30000

- CLI psql: v16.3

Additional Notes

- Dashboard "Reports/Database" indicates that before and during the issue, database connections did not exceed 10 total at any time

Attempted Solutions (That Failed)

- Suspend service for extended time (1h) and retry connection
- Restart Supabase project and immediately try connecting
- Restart Supabase service and wait a while doing nothing with it, then try connecting
- Change service environment variables to reduce number of attempted connections and decrease timeout times
- Add
SPRING_DATASOURCE_HIKARI_LEAK_DETECTION_THRESHOLD
SPRING_DATASOURCE_HIKARI_LEAK_DETECTION_THRESHOLD
to service environment (service cannot start without getting a connection initially, so it has not helped)
- Use session pooler instead of transaction pooler for service; this works for a few minutes (e.g. 30 mins) before stopping the service due to a different error:
o.h.engine.jdbc.spi.SqlExceptionHelper   : HikariPool-1 - Connection is not available, request timed out after 30001ms
o.h.engine.jdbc.spi.SqlExceptionHelper   : HikariPool-1 - Connection is not available, request timed out after 30001ms
; I have spent lots of time on this already and could not figure out a solution but that's a separate thing

Summary / TLDR

Using the Supabase database transaction pooler has worked fine for me for days, but then suddenly started constantly being at max client connections, even across restarts of the Supabase project. Nothing really happened around the time this started, and I have reason to believe I am not actually at the maximum number of connections. Connecting via the session pooler has a different issue (perhaps due to how I set it up?) that I discovered much earlier so I cannot use that either. How can I fix one of the two pooler issues so I can have a working connection?

Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Issues with max client connections reached
SupabaseSSupabase / help-and-questions
7mo ago
Max connections reached on large traffic
SupabaseSSupabase / help-and-questions
3y ago
Getting "Max client connections reached" with only 25/60 connections
SupabaseSSupabase / help-and-questions
3y ago
Switching from Session Pooler -> Transaction pooler
SupabaseSSupabase / help-and-questions
6mo ago