The Unexpected DB Connection Pool Leak in Our Rails App
25-Apr-2025 16
Everything looked fine — until it wasn’t. Out of nowhere, our worker tier started throwing this error:
could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use
We weren’t doing anything wild. Our RAILS_MAX_THREADS matched the DB pool size. No rogue threads. No unclosed connections. And yet, we were stuck.
Here’s how we tracked it down and what we learned from it.
The Unexpected DB Connection Pool Leak in Our Rails App #ruby #rubydeveloper #rubyonrails #Unexpected #Connection #Rails #db https://rubyonrails.ba/link/the-unexpected-db-connection-pool-leak-in-our-rails-app