Home
Sign Up
Sign In
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
0
V2EX
›
Python
python3 下配合 Tornado 的 mysql 驱动哪个比较好?
RRL
·
blackstorm
·
Oct 29, 2015
· 4715 views
This topic created in 4026 days ago, the information mentioned may be changed or developed.
Tornado
MySQL
Python3
驱动
12 replies
•
2015-10-30 17:41:17 +08:00
scys
Oct 29, 2015
1
1
aiomysql,tormysql 都需要稍微改造下才好用。
mouer
Oct 29, 2015
1
2
https://github.com/PyMySQL/Tornado-MySQL
sujin190
Oct 29, 2015
3
@
scys
怎么说?
scys
Oct 30, 2015
4
@
sujin190
都是很烂的连接池
sujin190
Oct 30, 2015
5
@
scys
那么连接池该怎么设计呢?
scys
Oct 30, 2015
6
@
sujin190
改造下回收和维护的列表,够我用就可以
sujin190
Oct 30, 2015
7
@
scys
ping 和常驻连接数么?其实我的想法是一个正常的 web 系统,总会有一两个连接是繁忙的,连接的使用的栈的方式的,超过一定时间回收,正常使用的话就已经有了常驻连接数和 ping 这两个行为了
scys
Oct 30, 2015
8
@
sujin190
问题出在是,现在这两个设计,是靠获取连接的时候,才处理连接关系。所以处理下会好点。
sujin190
Oct 30, 2015
9
@
scys
tormysql 在设置 idle_seconds 大于 0 时,后台有使用 tornado 的 timeout 的 check ,在一个连接空闲超过 idle_seconds 后会自动关闭回收连接的
sujin190
Oct 30, 2015
10
@
scys
我现在使用数据库一般是 8 小时,设置两小时的空闲超时时间,一般可以保证几个连接常驻,需要时又会快速打开新连接,又不会出现超时错误的情况
scys
Oct 30, 2015
11
@
sujin190
我希望的维持一定量睡眠中的连接,然后根据需求随时获取,但是每次睡眠时间周期不能太长,怕死连,然后要定期更新每个睡眠中的连接,这么一套机制。
sujin190
Oct 30, 2015
12
@
scys
但我觉得这一套太重了,一个正常的访问的 web 服务,不断的使用连接查询数据库,本身就会维护一定量的睡眠连接,完全没必要单独在实现这样一套机制了
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1380 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms ·
UTC 22:33
·
PVG 06:33
·
LAX 14:33
·
JFK 17:33
♥ Do have faith in what you're doing.
❯