In all versions of rails, I used the connection pool configured in config / database.yml
development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000
So just increase it:
development: adapter: sqlite3 database: db/development.sqlite3 pool: 10 timeout: 5000
Let me know if this is helpful.
UPDATE
It doesn't seem easy to put your values ββin / * environment files. rb. The closest way IMHO is to use ENV variables, as @Alessandro Caetano suggests.
There is a stone in the community for such operations: rais-dotenv
You can simply create .env.* Files for each environment, and then dotenv will load it accordingly.
Here is an example:
Then in your database.tml file
development: &main_db adapter: mysql2 encoding: utf8 reconnect: true database: <%= ENV['main_db_database'] %> pool: <%= ENV['main_db_pool'] ? ENV['main_db_pool'].to_i : 5 %> host: <%= ENV['main_db_host'] %> port: <%= ENV['main_db_port'] %> username: <%= ENV['main_db_username'] %> password: <%= ENV['main_db_password'] %>
retgoat
source share