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

selenium 爬虫会产生僵尸进程

  •  
  •   guoguobaba · Sep 8, 2023 · 2304 views
    This topic created in 1112 days ago, the information mentioned may be changed or developed.
    用 django 写了一个爬虫的服务,每执行一次就产生两个僵尸进程,需要定时重启 django 才行,如何解决

    已经调用过 driver.close() driver.quite() 了

    搜了一下网上很多这种问题,但是没有解决方案

    1 ? 00:00:00 python
    7 ? 00:00:03 python
    19 ? 00:00:00 firefox-esr <defunct>
    266 ? 00:00:00 firefox-esr <defunct>
    2 replies  •  2023-09-08 11:51:29 +08:00
    fatbear
        1
    fatbear  
       Sep 8, 2023
    看你的进程号 是在 docker 内跑的吗, 如果是在 docker 内跑的,需要加--init 的参数,或者用 bash 套一层,在 bash 里面在调 python 执行脚本
    guoguobaba
        2
    guoguobaba  
    OP
       Sep 8, 2023
    @fatbear 谢谢,k8s 里,dockerfile 加了
    ENTRYPOINT ["/usr/bin/tini", "--"]
    就 ok 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1027 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 18:13 · PVG 02:13 · LAX 11:13 · JFK 14:13
    ♥ Do have faith in what you're doing.