V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Jan 29, 2013 · 3835 views
    This topic created in 4845 days ago, the information mentioned may be changed or developed.
    之前是web.py+lighttpd来做的,更换Tornado的话,直接使用Tornado是不是会不太抗压?是不是应该配合Nginx来使用?
    5 replies    1970-01-01 08:00:00 +08:00
    whtsky
        1
    whtsky  
       Jan 29, 2013 via iPhone   ❤️ 1
    Tornado比Web.py抗压吧?
    个人都是Nginx反代给Tornado,静态交给Nginx.
    Veelian
        2
    Veelian  
    OP
       Jan 29, 2013
    @whtsky 这样反代理的作用是什么?如果没有静态,一个40W访问量的server,单单用Tornado扛得住么?
    whtsky
        3
    whtsky  
       Jan 29, 2013 via iPhone
    @Veelian 我的VPS上还要跑别的东西...
    Python有GIL限制,每个进程只能用到一个核。所以如果是多核的机器的话要开多个进程,然后用Nginx做负载均衡.
    「扛不扛得住」这种东西和框架关系真的不大,主要看你写的实现代码..
    Veelian
        4
    Veelian  
    OP
       Jan 29, 2013
    @whtsky tornado用nginx做负载均衡,如果有4个server(port不同), 每个server都需要 python app.py & 来启动,不能直接让nginx来管理吗?
    whtsky
        5
    whtsky  
       Jan 29, 2013 via iPhone
    @Veelian Nginx只是个服务器啊..
    官方推荐的是用Supervisor来管理,出了问题还可以自动重启什么的.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4017 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 04:19 · PVG 12:19 · LAX 21:19 · JFK 00:19
    ♥ Do have faith in what you're doing.