Closed fatpo closed 6 years ago
并不会的,之所有要用连接池就是要尽可能节省系统资源的,获取和释放连接其实内部就是一个collections.deque append和pop连接实例的过程,并不是设计连接操作,你可以测试一下collections.deque的性能看看,很快的
而且长时间持有连接而不是使用完就尽快把连接放入连接池,那么tornado高并发的下就只能多开很多连接来支持操作,这样多tornado和mysql都会消耗更多的资源来管理连接
明白了。理论上我们的宗旨是用完就放回池子里,不要hold住连接。 thx。
因为我的项目中,每一个DAO操作都要来一遍
想知道频繁的获取连接、释放连接,会不会给性能带来巨大消耗?
假设我的配置如下: