Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase max pool size in ActiveRecord?

I get the error:

Error "ActiveRecord::ConnectionTimeoutError - could not obtain a database connection within 5 seconds.  The max pool size is currently 5; consider increasing it." 

How do I increase the max pool size?

# DB CONNECTION DB_CONN = ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => DB_FILE) 
like image 941
Prakash Raman Avatar asked Oct 19 '10 07:10

Prakash Raman


People also ask

What does ActiveRecord base mean?

ActiveRecord::Base indicates that the ActiveRecord class or module has a static inner class called Base that you're extending.

What is pool in database Yml?

For anyone else who is looking for an answer to this question, the basic idea seems to be that a database can only support so many simultaneous connections, so there needs to a way to limit the open connections. The pool attribute specifies the maximum number of connections that can be opened at a given time.


1 Answers

config/database.yml pool: 8 (default is 5) 

Read more

like image 58
zengr Avatar answered Sep 24 '22 20:09

zengr