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

你们都用的是什么 wsgi 应用服务器

  •  
  •   oyjw443523 · Jan 11, 2021 · 4304 views
    This topic created in 1973 days ago, the information mentioned may be changed or developed.

    最近刚进了 python web 的坑,按着以前听说过的选了 flask 。结果最近网上看了一些资料好像已经落伍了。现在都用什么 fastapi 的异步框架了。 最近几天刚刚试了下 uwsgi,发现网上的配置都过时了,花了好久才启动好。有人用这个东西吗?有什么坑没?

    17 replies    2021-01-12 13:33:07 +08:00
    snachx
        1
    snachx  
       Jan 11, 2021
    用 gunicorn,简单好用
    knightdf
        2
    knightdf  
       Jan 11, 2021
    就 flask+gunicorn 啊
    phdh71
        3
    phdh71  
       Jan 11, 2021 via iPhone
    Gunicorn
    huangzhiyia
        4
    huangzhiyia  
       Jan 11, 2021
    gunicorn +1
    bleepbloop
        5
    bleepbloop  
       Jan 11, 2021
    meinheld
    jdhao
        6
    jdhao  
       Jan 11, 2021
    用的 uwsgi,感觉还可以啊,有什么问题吗。
    oyjw443523
        7
    oyjw443523  
    OP
       Jan 11, 2021
    @jdhao 倒是没遇到什么问题。就想问有什么坑没。
    piqizhu8
        8
    piqizhu8  
       Jan 11, 2021
    Gunicorn +1,还有更好的吗
    Lemeng
        9
    Lemeng  
       Jan 11, 2021
    答案有了,加油
    houzhiqiang
        10
    houzhiqiang  
       Jan 11, 2021
    Gunicorn + Gevent 路过
    Macv1994
        11
    Macv1994  
       Jan 11, 2021   ❤️ 1
    flask + gunicorn + supervisor 挺方便的
    oyjw443523
        12
    oyjw443523  
    OP
       Jan 11, 2021
    这么多人用 gunicorn 的吗?有机会试试
    neoblackcap
        13
    neoblackcap  
       Jan 11, 2021
    uWSGI 跟 gunicorn 都很成熟的方案

    uWSGI 主要是用 C 写的,一来效率高,二来它自带很多功能,比如集群管理,还有进程管理啥的。单单用它就可以实现其他 wsgi 服务器+进程管理器的效果。还有一点就是它跟 nginx 结合比较好,nginx 跟它通讯是二进制的 uwsgi 协议(他们自己都吐槽取了一个坏协议名),理论上会比 gunicorn 跟 nginx 之间通讯高效

    gunicorn 也是一个很高效的 wsgi 服务器,一来它很容易配置,二来它还有很多 worker 可以进一步压榨性能,当然了,它自身的性能也不差。同时它还能通过跟 uvicorn 结合,作为一个可以用于生产环境的 asgi 服务器。
    614457662
        14
    614457662  
       Jan 11, 2021 via Android
    17 到 19 年我用的 django+uwsgi+nginx,20 年 flask+gunicorn,今年 fastapi+uvicorn+gunicorn
    kaka6
        15
    kaka6  
       Jan 12, 2021
    flask+gunicorn 放入 docker 中运行
    kaka6
        16
    kaka6  
       Jan 12, 2021
    nginx + docker(flask+gunicorn)
    ytymf
        17
    ytymf  
       Jan 12, 2021
    @neoblackcap 这个取名真的是。还记得当年看 uwsgi 跟 uWSGI 有什么区别,nginx 跟 uWSGI 之间是什么协议之类的文章看得头晕脑胀。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2837 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 68ms · UTC 04:28 · PVG 12:28 · LAX 21:28 · JFK 00:28
    ♥ Do have faith in what you're doing.