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

使用web.py框架时,针对单个post请求,能够使用多进程来处理并返回结果吗?,最近总是被这个问题困扰,请教大牛们,这是由于web.py处理请求是单程线的吗,有没有好的框架来解决这个问题?

  •  
  •   shade · Nov 2, 2013 · 4605 views
    This topic created in 4748 days ago, the information mentioned may be changed or developed.
    4 replies  •  1970-01-01 08:00:00 +08:00
    laiwei
    laiwei
    Nov 3, 2013 via Android
    1
    你得配合 nginx,uwsgi,webpy一起来工作

    nginx起多个worker,静态文件直接用nginx处理

    动态请求转发给uwsgi

    uwsgi也起多个worker
    shade
    shade
    OP
    Nov 3, 2013
    2
    谢谢@laiwei,上面的方案应该是针对多个请求来并发处理,提高处理的速度,我想问得是针对单个post请求,framework接到请求后,能够再post处理函数下能建立多进程吗,我觉得用twisted来建立web服务器应该能够实现。不知到可行不可行
    thedevil5032
    thedevil5032
    Nov 3, 2013 via iPad
    3
    Celery
    9hills
    9hills
    Nov 3, 2013
    4
    @shade 两种方法都可以
    1. 用线程池
    2. 用Celery或者Python-RQ 来调度

    我建议用2,比较简单
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5068 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:55 · PVG 15:55 · LAX 23:55 · JFK 02:55
    ♥ Do have faith in what you're doing.