Hanami.app.configure_provider :db do
config.gateway :default do |gw|
gw.connection_options max_connections: 10
end
end
Both of these are mentioned here in our database guide. If you think something is missing here or there is any way we could make it clearer, I’m always happy to receive feedback
And please keep us in the loop regarding your TechEmpower experiments. If this adjustment doesn’t work, I’d love to help you figure it out.
If you’re hitting connection pool limits in Hanami and changing max_connections didn’t help, it’s usually not the pool size itself. As you found out, a memory leak in rom.rb was causing problems. The rule of thumb for tuning, though, is that the pool size should be at least as big as the number of threads times the number of workers. This way, every thread can get a connection. But always check for leaks or transactions that last a long time first. No amount of pool tweaking will help if your ROM or adapters are holding onto connections longer than they should.