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

celery worker 会消失

  •  
  •   julyclyde ·
    julyclyde · Apr 23, 2016 · 5687 views
    This topic created in 3817 days ago, the information mentioned may be changed or developed.
    最近几个月发现, celery worker 跑几天就卡死了,进程还在,但不干活
    装了 flower 之后,发现 prefork 模式的这些 worker ,大概一天左右就不再被 flower 列出来了,估计是没向 broker 发心跳?

    换 gevent worker 之后能一直保持运行
    3.1.X 版本

    大家有没有遇到类似的情况?
    6 replies  •  2016-04-24 19:47:35 +08:00
    calease
        1
    calease  
       Apr 24, 2016
    从来没用过 prefork 的 worker 。
    在 rabbitmq web interface 上看 message 有没有被正常 consume 。
    julyclyde
        2
    julyclyde  
    OP
       Apr 24, 2016
    @calease 没 consume ;我的是 redis ,我看 len(events)越来越大
    calease
        3
    calease  
       Apr 24, 2016
    我记得 redis messages 是存在 celery 这个 key 里的吧,用 scard(celery)看 message 的数量。
    但我也从没遇过 worker 停止的问题。用-l DEBUG 看看?
    julyclyde
        4
    julyclyde  
    OP
       Apr 24, 2016
    @calease 不是 celery 这个 key 啊。消息是 kombu 处理的, kombu 哪儿认识谁是 celery 啊……
    zhouquanbest
        5
    zhouquanbest  
       Apr 24, 2016
    Celery 的坑找起来还是很麻烦的 你要是想先快速解决 再找慢慢找 bug 的话
    可以先配置下 celery worker 自杀 设定执行个千百次自杀重启好了
    在服务端很常见的解决方案
    julyclyde
        6
    julyclyde  
    OP
       Apr 24, 2016
    @zhouquanbest 我设置了 timelimit ,但没什么效果,所以我怀疑是 prefork 模式的 master 进程有问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1106 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:59 · PVG 00:59 · LAX 09:59 · JFK 12:59
    ♥ Do have faith in what you're doing.