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

Scrapy active_size 大小持续增长问题咨询

  •  
  •   xiudou · Mar 8, 2018 · 2135 views
    This topic created in 3125 days ago, the information mentioned may be changed or developed.
    我的理解 engine.scraper.slot.active_size 是 engine.scraper.slot.active 中的抓取器处理的响应大小。
    但是用 telnet 查看爬虫时发现 engine.scraper.slot.active 一直是 0,但是 engine.scraper.slot.active_size 的值确越来越大。
    有没有哪位朋友碰到过这种情况呢?想咨询下造成这种问题的原因。
    谢谢
    1 replies  •  2018-03-19 11:26:29 +08:00
    xiudou
        1
    xiudou  
    OP
       Mar 19, 2018
    做个结帖。
    这个问题的原因是:出于某种原因,我们在处理 response 时,替换了 body,导致最后 scraper 减去的 response 的 size 于了下载器下载的大小。当出现较多处理时,会当值 active_size 超过了 5M 的阈值。会造成爬虫一直卡住,不处理下一个请求。
    这个问题一般也不会出现,大家可以忽略。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5028 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:29 · PVG 16:29 · LAX 01:29 · JFK 04:29
    ♥ Do have faith in what you're doing.