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?
UPDATE If anyone else is curious, I just found a commit that explains it: https://github.com/rails/rails/commit/b700153507b7d539a57a6e3bcf03c84776795051
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.