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

最近爬虫总是 Segmentation fault,何解?

  •  
  •   JianBingXia · Jul 21, 2016 · 2752 views
    This topic created in 3728 days ago, the information mentioned may be changed or developed.

    这个 Segmentation fault 出现在多线程爬取内容的时候

    1.现在的逻辑是把列表的 url 都取下来放 mysql,status 字段为 0

    2.内容爬虫从 mysql 每次取 1000 条 url 放 redis 队列(这是一个 while ,里面是第 3 步)

    3.起 5 个线程,每个线程都是一个 while True 循环,从队列取 url,获取内容之后mysql通过此条id将status置1,取到为 null 再重复 2 的取 1000 条(第 2 步的循环).

    (这里好像第二次取 1000 条的时候,启的 5 个线程是新的,默认 name 和前 5 个不同,原来的 5 个线程不用手动关闭?因为我没找到方法结束子线程.是不是我操作的不对?)

    4.setDaemon(True)了,join 了

    昨天查了下设置了如下两个 ulimit -c unlimited|ulimit unlimited 不顶用

    求大神帮解

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2430 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:06 · PVG 15:06 · LAX 00:06 · JFK 03:06
    ♥ Do have faith in what you're doing.