aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-02-26 12:51:13 -0800
committerXavier Noria <fxn@hashref.com>2012-02-26 12:51:13 -0800
commit5c0aba238c37a71fce08f949bc2c6bdd9aab4f7b (patch)
tree1f8848dcff5a24df0207a6d53e8635a416cc68d3 /railties/guides
parent9b2c38b7bd582d9712c3779294a9bccde7bbd548 (diff)
downloadrails-5c0aba238c37a71fce08f949bc2c6bdd9aab4f7b.tar.gz
rails-5c0aba238c37a71fce08f949bc2c6bdd9aab4f7b.tar.bz2
rails-5c0aba238c37a71fce08f949bc2c6bdd9aab4f7b.zip
updates the new default pool size in some additional places
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/command_line.textile4
-rw-r--r--railties/guides/source/configuring.textile8
-rw-r--r--railties/guides/source/getting_started.textile12
3 files changed, 17 insertions, 7 deletions
diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile
index fe4a84dae9..8ae8c61ae6 100644
--- a/railties/guides/source/command_line.textile
+++ b/railties/guides/source/command_line.textile
@@ -521,7 +521,9 @@ development:
adapter: postgresql
encoding: unicode
database: gitapp_development
- pool: 5
+ # Maximum number of database connections available per process. Please
+ # increase this number in multithreaded applications.
+ pool: 1
username: gitapp
password:
...
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index 2f465b37ed..e796f44606 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -652,17 +652,19 @@ The error occurred while evaluating nil.each
h3. Database pooling
-Active Record database connections are managed by +ActiveRecord::ConnectionAdapters::ConnectionPool+ which ensures that a connection pool synchronizes the amount of thread access to a limited number of database connections. This limit defaults to 5 and can be configured in +database.yml+.
+Active Record database connections are managed by +ActiveRecord::ConnectionAdapters::ConnectionPool+ which ensures that a connection pool synchronizes the amount of thread access to a limited number of database connections. This limit defaults to 1 and can be configured in +database.yml+.
<ruby>
development:
adapter: sqlite3
database: db/development.sqlite3
- pool: 5
+ # Maximum number of database connections available per process. Please
+ # increase this number in multithreaded applications.
+ pool: 1
timeout: 5000
</ruby>
-Since the connection pooling is handled inside of ActiveRecord by default, all application servers (Thin, mongrel, Unicorn etc.) should behave the same. Initially, the database connection pool is empty and it will create additional connections as the demand for them increases, until it reaches the connection pool limit.
+Since the connection pooling is handled inside of Active Record by default, all application servers (Thin, Mongrel, Unicorn etc.) should behave the same. Initially, the database connection pool is empty and it will create additional connections as the demand for them increases, until it reaches the connection pool limit.
Any one request will check out a connection the first time it requires access to the database, after which it will check the connection back in, at the end of the request, meaning that the additional connection slot will be available again for the next request in the queue.
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index bed14ef6a8..d6f3c3e217 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -329,7 +329,9 @@ environment:
development:
adapter: sqlite3
database: db/development.sqlite3
- pool: 5
+ # Maximum number of database connections available per process. Please
+ # increase this number in multithreaded applications.
+ pool: 1
timeout: 5000
</yaml>
@@ -350,7 +352,9 @@ development:
adapter: mysql2
encoding: utf8
database: blog_development
- pool: 5
+ # Maximum number of database connections available per process. Please
+ # increase this number in multithreaded applications.
+ pool: 1
username: root
password:
socket: /tmp/mysql.sock
@@ -370,7 +374,9 @@ development:
adapter: postgresql
encoding: unicode
database: blog_development
- pool: 5
+ # Maximum number of database connections available per process. Please
+ # increase this number in multithreaded applications.
+ pool: 1
username: blog
password:
</yaml>