Rails 7.2 Connection Pool Changes May Slow Down Your App | Code With Rails
09-Jan-2026 701
After upgrading to Rails 7.2, you might notice your app is a bit slower. Not dramatically, but measurably—around 5-6% in real-world benchmarks. It comes down to how ActiveRecord now manages database connections.
The Change
In Rails 7.1, each thread held onto its database connection for the duration of a request.
Rails 7.2 flipped this: connections are now checked out for each query and returned immediately after. The goal was better connection sharing in multi-threaded environments where connections are scarce.
Rails 7.2 Connection Pool Changes May Slow Down Your App | Code With Rails #ruby #rubydeveloper #rubyonrails #Rails #Connection #Changes #Rails #code https://rubyonrails.ba/link/rails-7-2-connection-pool-changes-may-slow-down-your-app-code-with-rails