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
Veelian
V2EX  ›  Python

Tornado有必要另外配合一个Web Server使用么?

  •  
  •   Veelian · 2013-01-29 11:53:07 +08:00 · 3181 次点击
    这是一个创建于 4106 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前是web.py+lighttpd来做的,更换Tornado的话,直接使用Tornado是不是会不太抗压?是不是应该配合Nginx来使用?
    5 条回复    1970-01-01 08:00:00 +08:00
    whtsky
        1
    whtsky  
       2013-01-29 11:55:34 +08:00 via iPhone   ❤️ 1
    Tornado比Web.py抗压吧?
    个人都是Nginx反代给Tornado,静态交给Nginx.
    Veelian
        2
    Veelian  
    OP
       2013-01-29 12:00:47 +08:00
    @whtsky 这样反代理的作用是什么?如果没有静态,一个40W访问量的server,单单用Tornado扛得住么?
    whtsky
        3
    whtsky  
       2013-01-29 12:18:18 +08:00 via iPhone
    @Veelian 我的VPS上还要跑别的东西...
    Python有GIL限制,每个进程只能用到一个核。所以如果是多核的机器的话要开多个进程,然后用Nginx做负载均衡.
    「扛不扛得住」这种东西和框架关系真的不大,主要看你写的实现代码..
    Veelian
        4
    Veelian  
    OP
       2013-01-29 18:23:28 +08:00
    @whtsky tornado用nginx做负载均衡,如果有4个server(port不同), 每个server都需要 python app.py & 来启动,不能直接让nginx来管理吗?
    whtsky
        5
    whtsky  
       2013-01-29 18:36:26 +08:00 via iPhone
    @Veelian Nginx只是个服务器啊..
    官方推荐的是用Supervisor来管理,出了问题还可以自动重启什么的.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1404 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:27 · PVG 01:27 · LAX 10:27 · JFK 13:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.