V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
feather12315
V2EX  ›  问与答

scrapy 运行 24h 后速度变慢

  •  
  •   feather12315 · Apr 9, 2016 · 1582 views
    This topic created in 3671 days ago, the information mentioned may be changed or developed.

    DigitalOcean $5/mon 配置。 scrapy 运行在 docker 容器中。

    DOWNLOAD_DELAY = 1
    LOG_LEVEL = 'INFO'
    

    使用 cookie ,每次传入的 cookie 总是同一个。抓取微博的各种数据。

    这里是使用的代码

    scrapy 连续运行 24H 后(很准时),速度总会变为原来的 1/2 。

    假如是内存不够的话,第一次设置 DELAY=2 , 24h 后速度变为原来 1/2 ;第二次设置 DELAY=1 , 24h 后速度变为原来 1/2 。第三次运行中又开了一个 uwsgi 容器,速度也是 24h 后变为原来的 1/2 。这也太准时了吧!

    假如是 cookies 的原因,设置 24h 后重新登录,速度还是会在 24h 后变为原来的 1/2 。

    这是为啥呢?求老司机帮助

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5086 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 05:39 · PVG 13:39 · LAX 22:39 · JFK 01:39
    ♥ Do have faith in what you're doing.