Git Product home page Git Product logo

你好,大佬,请问一个问题,我用scrapy-redis执行爬虫的时候,设置最大并发是20,但是怎么感觉像创建20个队列一样,上一个20执行完之后,下一个20再执行,大佬,您能为我解答一下吗,感激不尽 about scrapy-redis HOT 2 CLOSED

zhanghongdou avatar zhanghongdou commented on May 25, 2024
你好,大佬,请问一个问题,我用scrapy-redis执行爬虫的时候,设置最大并发是20,但是怎么感觉像创建20个队列一样,上一个20执行完之后,下一个20再执行,大佬,您能为我解答一下吗,感激不尽

from scrapy-redis.

Comments (2)

Zerorigin avatar Zerorigin commented on May 25, 2024

首先你需要贴出你的爬虫设置(所有并发相关的)
其次尽量用英文提问

话说我很久没用 scrapy-redis 了
而且之前使用时一直特地限制并发
所以都忘了具体是啥情况

只能期望有其他人帮你回答了

from scrapy-redis.

LuckyPigeon avatar LuckyPigeon commented on May 25, 2024

@zhanghongdou
最大并發是 scrapy 內建選項,並非 scrapy-redis,可以去 scrapy 群取得更詳細資訊。
以你上述問題來說,答案是「對」,python 的 multiprocessing 是透過排程不斷在執行序間轉換,形成一種「類併發」。而 scrapy 調用這方法使用的是 queue,將最大併發數的 requests 打入 queue,再發給執行序們執行。

可以參考
文件:https://docs.scrapy.org/en/latest/topics/settings.html
程式碼:https://github.com/scrapy/scrapy/blob/master/scrapy/core/downloader/__init__.py

from scrapy-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.