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

django 并发下载图片优化

  •  
  •   myKing · Feb 22, 2019 · 2605 views
    This topic created in 2668 days ago, the information mentioned may be changed or developed.

    我想问问我的 django 框架 在服务器 5m 网址 20 并发时获取 500kb,使用 fileresponse 返回图片是,平均获取 10s,这个怎么优化

    服务器配置:阿里云 cpu 8 核 内存 32g 网速 5m

    3 replies    2019-02-22 11:15:48 +08:00
    kkjinping
        1
    kkjinping  
       Feb 22, 2019
    图片很大? 5M 的网 500K 速度差不多也快到头了
    aniua
        2
    aniua  
       Feb 22, 2019
    下载图片用 Nginx 等 Web 代理取代,资源安全性通过动态修改文件名实现。
    xpresslink
        3
    xpresslink  
       Feb 22, 2019
    是静态图片么?
    理论上说根本不应该让 django 来做提供静态图片的服务。
    应该直接用 Nginx 直接来处理静态图片。最好直接用阿里云的 OSS 打开静态网站功能,还能开启 CDN 加速。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2634 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 01:41 · PVG 09:41 · LAX 18:41 · JFK 21:41
    ♥ Do have faith in what you're doing.