V2EX › Python
bae python 经常 mysql connection not available 是为何?
By crytis at 2016 年 10 月 17 日 · 3502 次点击用的 bae 最基础的那款, mysql 免费的。 bae 限制全是短连接,超时时间 30s 。 我用了 sqlalchemy ,之前 google 的, create_engine 的时候加了 pool_recycle=3600 ,但是还是有这个错。 每个 session 用完也都 close 了。 这个如何破?
2 条回复 • 2016-10-18 22:59:13 +08:00
|
1
crytis OP 呃,复制错了 ,加的是 pool_recycle=60 ( sae 文档里推荐的)
|
|
2
crytis OP 设置成 30s 就没问题了, 60s 应该是新浪为了减轻压力推荐的值
|
推荐学习书目
› 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