gevent: gunicorn vs uWSGI - V2EX
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
phuslu

gevent: gunicorn vs uWSGI

  •  
  •   phuslu 2012 年 10 月 22 日 14030 次点击
    这是一个创建于 4932 天前的主题,其中的信息可能已经有所发展或是发生改变。
    http://ivan-site.com/2012/10/gevent-gunicorn-vs-uwsgi/

    推荐一下, 我觉得结果比较可信, 和我在实际项目感受的结果一致.
    也是为数不多的测试 uwsgi+gevent 性能的一个 bechmark.
    6 条回复    1970-01-01 08:00:00 +08:00
    phuslu
        1
    phuslu  
    OP
       2012 年 10 月 22 日
    uwsgi 现在已经支持 gevent 作为 LoopEngine, 不知道大家有没有人在用
    http://projects.unbit.it/uwsgi/wiki/Gevent
    phuslu
        2
    phuslu  
    OP
       2012 年 10 月 22 日
    最后一段作者结论, 我比较认同 :-)

    """
    As you can see, the results are pretty close with uWSGI having a slight edge in throughput in some cases and gunicorn having a slight advantage in request times. I think we can safely conclude that most of the work is being handled by gevent in this benchmark, so the server doesn’t actually play a huge role in performance. That being said, gunicorn is a lot easier to install as it doesn’t need manual compilation or beta versions of gevent.
    """
    phuslu
        3
    phuslu  
    OP
       2012 年 10 月 22 日
    事实上, gunicorn 调用 gevent workers 的代码类似这样的原理(uwsgi+gevent 也是差不多的做法).
    http://gist.github.com/3928092
    gunicorn 是非常值得尝试的. :)
    CMGS
        4
    CMGS  
       2012 年 10 月 22 日
    gunicorn目前在用,很“实用性”的server,相对于性能逆天的bjoern,gunicorn在提供稳定支持的情况下能最大的利用CPU和用不同Type的Worker去提升性能。uWSGI的问题在于1)源码太乱(导致bjoern出生)2)Hack的话不如Gunicorn方便。3)性能没太多亮点,一个C的和一个纯Python的几乎一致,何苦呢。

    而fapws3也有类似的问题,性能/扩展性/进程管理,这又是另外一堆内容了……

    而Gevent,也是“实用性”的异步网络层框架,理由很简单,无论是bug性能级的meinheld还是类似的eventlet,第三方库的支持很重要,而gevent这一点上做得不错,包括我们现在做的活,很容易移植一个项目基于gevent异步起来。

    至于异步是否是最优,这又是另外一段内容了……挨踢技术横竖都是回归型的……

    最后吐槽一下Gevent 1.0b4,各种坑……不要轻易尝试吧,改subprocess,fileobj,os这几个核心模块的monkey不是那么容易完成的,1.0b3相对稳定一些。
    phuslu
        5
    phuslu  
    OP
       2012 年 10 月 22 日
    @CMGS
    嗯. bjoern/fapws3/meinheld 都不够完备, 只能算一个 wsgi server.
    gevent 就好多了, 1.0b4 多了 subprocess/fileobject 也是大势所趋.
    CMGS
        6
    CMGS  
       2012 年 10 月 22 日
    1.0b4坑太多了……dev版本都稳定些= =
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     4894 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 41ms UTC 05:41 PVG 13:41 LAX 22:41 JFK 01:41
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86