V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
fanzeyi
V2EX  ›  Apache

mod_wsgi 与 Apache 的 Mysql 问题....

  •  
  •   fanzeyi · Jul 22, 2011 · 4846 views
    This topic created in 5395 days ago, the information mentioned may be changed or developed.
    部署的 Web.py 应用..

    遇到好多次了

    先是在 dotcloud .. 经常性的出现 Too many connections .. 先是认为 SQLAlchemy 没有写好.. 在本机用 nginx + uwsgi 调试也发现有这个问题 最终找到是 session 未释放 修改之后在本机的 nginx + uwsgi 顺利通过测试

    但是在 dotcloud 上还是会出现 too many connections 的错误 有时候还会蹦 404 后来就没管他

    然后换到了一个 CentOS 5.5 的服务器上.. python 版本 2.4

    Apache 的服务器.. 用的 mod_wsgi 做 python 的 CGI .. 但是还是会出现 Too many connections 的错误 搜到 这个 http://zsuxqm.blog.163.com/blog/static/6467812010528112511563/

    然后按照他的方法在Mysql配置文件里面写上

    max_connections = 1000
    wait_timeout = 30
    connect_timeout = 30

    虽然还是会经常性的出现 too many connections 但是等30秒就好... 不知道问题出在哪里

    【准备去装个虚拟机 里面用 apache 和 mod_wsgi 测试下..
    1 replies    1970-01-01 08:00:00 +08:00
    fanzeyi
        1
    fanzeyi  
    OP
       Jul 22, 2011
    好吧 确认这个不是 Apache + mod_wsgi 的问题

    今天在虚拟机里面装了一套 Arch + Python 2.4

    MySQL 用的是本机的 MySQL 14.14

    服务器的 MySQL 版本是 14.12

    压力测试表示顺利通过.... 虽然有时候会偶尔蹦下 too many connections 但是瞬间错误就没有了(嘛 说明还是 nginx+uWSGI 的组合好点~)

    现在准备用本机的nginx测试服务器上的MySQL
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   922 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:52 · PVG 04:52 · LAX 13:52 · JFK 16:52
    ♥ Do have faith in what you're doing.