Rails: Does every http request creates a new conne

2019-05-06 12:30发布

问题:

i am reading this article https://polycrystal.org/posts/2012-05-25-active-record-connection-pool-fairness.html and it states that every http reuest create a new connection pool. is it true??

If it is true then what if a http request creates two threads that needs to access database then will that two threads create two separate connection pool agian or they will use the connection pool created by a http request.

Thanks,

回答1:

Not request, but every worker process. The whole concept of connection pooling is to eliminate the need for establishing a db connection in every request.