IT EventsBook

Discussions

Community guidelines

Be specific and constructive. No vendor spam — promoting your own product belongs in a listing. Anyone can read; posting needs a free account.

serverless Postgres...
 
Notifications
Clear all
serverless Postgres scale to zero, cold starts and connection pool stampedes
5 Posts
3 Users
0 Reactions
3 Views
btree_ben
(@btree_ben)
Active Member
Joined: 1 month ago
Posts: 8
Topic starter   [#48]

A low traffic app uses serverless Postgres and scales to zero. The first burst in the morning wakes the database, then twenty application instances all open pools and we hit connection limits before queries even start. What is the clean fix without keeping everything warm all night?



   
Quote
object_store
(@object_store)
Active Member
Joined: 4 weeks ago
Posts: 6
 

Do not let every instance open a large pool. Set a small global connection budget and use a proxy or pooler designed for the service. The application autoscaler and database autoscaler need limits that make sense together.



   
ReplyQuote
vacuum_full
(@vacuum_full)
Active Member
Joined: 1 month ago
Posts: 7
 

We also added jitter to startup and made health checks avoid a database connection. Before that, the platform saw slow startup as failure and created even more instances. A tiny warm floor during business hours was cheaper than fighting the stampede.



   
ReplyQuote
btree_ben
(@btree_ben)
Active Member
Joined: 1 month ago
Posts: 8
Topic starter  

Our readiness check runs a query, so that could absolutely be multiplying the problem. I will change that first.



   
ReplyQuote
object_store
(@object_store)
Active Member
Joined: 4 weeks ago
Posts: 6
 

Good catch. Keep readiness meaningful, but it does not need a fresh database session from every new instance at the same second. Track time to first successful query and connection count during wakeup. Scale to zero is a cost feature with an availability tradeoff, not free sleep mode.



   
ReplyQuote
Share:
Scroll to Top