I was wondering about the following setting in the Rails database.yml:
By default the number of database connections for the connection pool of ActiveRecord is set to 5:
development: ... pool: 5
But by default, Rails 3 is single threaded.
Why would you need 5 connections by default?
As far as I understand, a single threaded Rails app can't trigger multiple database operations at once, why would do you need to keep more connection open?
I would assume that 2 connections would make sense, so you always have one active connection even if the other one times out, but holding five connections seems a little odd to me.
Am I missing something?
If anyone else is curious, I just found a commit that explains it:
In fact these default settings don't make any sense, it was fixed but then temporarily reverted (one year ago) because of the test suite.