Rails:每个http请求都会创建一个新的连接池吗? [英] Rails: Does every http request creates a new connection pool?

查看:91
本文介绍了Rails:每个http请求都会创建一个新的连接池吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读本文 https://polycrystal.org/posts/2012-05-25-active-record-connection-pool-fairness.html ,并指出每个http请求都将创建一个新的连接池.是真的吗?

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??

如果为true,那么如果http请求创建了两个需要访问数据库的线程,那两个线程将创建两个单独的连接池agian或它们将使用http请求创建的连接池怎么办?

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.

谢谢

推荐答案

不是请求,而是每个工作进程.连接池的整个概念是消除在每个请求中建立数据库连接的需要.

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.

这篇关于Rails:每个http请求都会创建一个新的连接池吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆