推荐学习书目
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
crytis
V2EX  ›  Python

bae python 经常 mysql connection not available 是为何?

  •  
  •   crytis · Oct 17, 2016 · 3238 views
    This topic created in 3496 days ago, the information mentioned may be changed or developed.

    用的 bae 最基础的那款, mysql 免费的。 bae 限制全是短连接,超时时间 30s 。 我用了 sqlalchemy ,之前 google 的, create_engine 的时候加了 pool_recycle=3600 ,但是还是有这个错。 每个 session 用完也都 close 了。 这个如何破?

    2 replies    2016-10-18 22:59:13 +08:00
    crytis
        1
    crytis  
    OP
       Oct 17, 2016
    呃,复制错了 ,加的是 pool_recycle=60 ( sae 文档里推荐的)
    crytis
        2
    crytis  
    OP
       Oct 18, 2016 via iPhone
    设置成 30s 就没问题了, 60s 应该是新浪为了减轻压力推荐的值
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   918 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:44 · PVG 04:44 · LAX 13:44 · JFK 16:44
    ♥ Do have faith in what you're doing.