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

有人在生产环境用 Sanic 吗?有什么需要注意的坑吗?看起来性能很强还轻量。我记得以前这个框架有乱关闭长连接的 Bug,花了一年多才修复

  •  
  •   drymonfidelia · Feb 16, 2025 · 4001 views
    This topic created in 478 days ago, the information mentioned may be changed or developed.
    这个框架我在一些小项目用过一段时间了,我记得前年年初刚开始用这个框架的时候经常会出现 5s 以上的连接被提前关掉的 Bug ,去年年中的版本里面他们终于修复了。不知道还有没有别的坑。
    4 replies    2025-02-17 13:27:25 +08:00
    w568w
        1
    w568w  
       Feb 16, 2025
    现在在用,没遇到过什么大问题。

    不过说性能的话,其实不如 FastAPI 啊,高吞吐量场景下大约会慢一些。
    UB
        2
    UB  
       Feb 16, 2025
    @w568w 我也在纠结要选择 sanic 或者 fastapi, 但是关于性能,我在这个网站看到的 benchmark 结果是 sanic 略微好一点 https://web-frameworks-benchmark.netlify.app/compare?f=sanic,fastapi
    Te11UA
        3
    Te11UA  
       Feb 16, 2025
    不太建议,还是转用成熟的,也好解决。就那些性能区别,远没有代码效率和生态重要
    love2075904
        4
    love2075904  
       Feb 17, 2025
    我建议还是 fastapi 吧,成熟稳定
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3425 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 11:44 · PVG 19:44 · LAX 04:44 · JFK 07:44
    ♥ Do have faith in what you're doing.