# DB connection pooling support?

**URL:** <https://www.ruby-forum.com/t/db-connection-pooling-support/48686>\
**Category:** Rails\
**Created:** [November 23, 2005, 2:41pm UTC](https://www.ruby-forum.com/t/db-connection-pooling-support/48686 "2005-11-23T14:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [November 23, 2005, 2:41pm UTC](https://www.ruby-forum.com/t/db-connection-pooling-support/48686/1 "2005-11-23T14:41:30Z")

</div>

Does rails support connection pooling for DB connections? Or are  
connections just opened and closed as needed.

Thanks,  
Joe

---

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [November 23, 2005, 3:58pm UTC](https://www.ruby-forum.com/t/db-connection-pooling-support/48686/2 "2005-11-23T15:58:11Z")

</div>

On 23/11/05, Joe S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Does rails support connection pooling for DB connections? Or are  
> connections just opened and closed as needed.

DB connection pooling doesnt’ make much sense for Rails.  
Generally you have fastcgi children, each with their dbhandle, which  
are themselves started and stopped by the webserver as needed.

Think of them like threads in a servlet engine.

–  
Rasputin :: Jack of All Trades - Master of Nuns  
[http://number9.hellooperator.net/](http://number9.hellooperator.net/)

---

<div class="post-metadata">

**Author:** ![jsimone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@jsimone](https://www.ruby-forum.com/u/jsimone)\
**Post date:** [November 23, 2005, 5:22pm UTC](https://www.ruby-forum.com/t/db-connection-pooling-support/48686/3 "2005-11-23T17:22:51Z")

</div>

On 11/23/05, Dick D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> DB connection pooling doesnt’ make much sense for Rails.  
> Generally you have fastcgi children, each with their dbhandle, which  
> are themselves started and stopped by the webserver as needed.

This is true running under FastCGI (though connection timeouts can  
still be an issue). Under other environments, such as WEBrick or  
using ActiveRecord standalone, this isn’t always the case. There is  
work being done towards an adapter pool for ActiveRecord, see  
[http://dev.rubyonrails.org/ticket/2162](http://dev.rubyonrails.org/ticket/2162)

Tom
