为什么django不支持连接池? [英] Why doesn't django support connection pool?
问题描述
(我尝试使用 TypeError:init()只需要1个参数(3个给定的值),但是它们不能同时使用, )
)
编辑:查看 Django持久数据库连接(1.6中介绍的功能)
持续连接避免在每个请求中重新建立与数据库的连接的开销。它们由CONN_MAX_AGE参数控制,该参数定义了连接的最大使用寿命。可以为每个数据库独立设置。
i wonder why django doesnt support connection pool ? I can't bear open/close connection every request. I try to solve it , but hasn't a good solution
(I try to use mysql_pool , but fail. TypeError: init() takes exactly 1 argument (3 given) )
EDITED: look at Django persistent database connection (feature introduced in 1.6).
Persistent connections avoid the overhead of re-establishing a connection to the database in each request. They’re controlled by the CONN_MAX_AGE parameter which defines the maximum lifetime of a connection. It can be set independently for each database.
这篇关于为什么django不支持连接池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!