V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2016-10-17 11:36:16 +08:00 · 2789 次点击
    这是一个创建于 2741 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    2 条回复    2016-10-18 22:59:13 +08:00
    crytis
        1
    crytis  
    OP
       2016-10-17 12:01:11 +08:00
    呃,复制错了 ,加的是 pool_recycle=60 ( sae 文档里推荐的)
    crytis
        2
    crytis  
    OP
       2016-10-18 22:59:13 +08:00 via iPhone
    设置成 30s 就没问题了, 60s 应该是新浪为了减轻压力推荐的值
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1221 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:07 · PVG 02:07 · LAX 11:07 · JFK 14:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.