V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 233 天前 · 948 次点击
    这是一个创建于 233 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用 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 条回复    2023-09-08 11:51:29 +08:00
    fatbear
        1
    fatbear  
       233 天前
    看你的进程号 是在 docker 内跑的吗, 如果是在 docker 内跑的,需要加--init 的参数,或者用 bash 套一层,在 bash 里面在调 python 执行脚本
    guoguobaba
        2
    guoguobaba  
    OP
       233 天前
    @fatbear 谢谢,k8s 里,dockerfile 加了
    ENTRYPOINT ["/usr/bin/tini", "--"]
    就 ok 了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1092 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:41 · PVG 02:41 · LAX 11:41 · JFK 14:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.