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
julyclyde
V2EX  ›  Python

celery worker 会消失

  •  
  •   julyclyde ·
    julyclyde · 2016-04-23 21:42:02 +08:00 · 4501 次点击
    这是一个创建于 2896 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近几个月发现, celery worker 跑几天就卡死了,进程还在,但不干活
    装了 flower 之后,发现 prefork 模式的这些 worker ,大概一天左右就不再被 flower 列出来了,估计是没向 broker 发心跳?

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

    大家有没有遇到类似的情况?
    6 条回复    2016-04-24 19:47:35 +08:00
    calease
        1
    calease  
       2016-04-24 02:40:09 +08:00
    从来没用过 prefork 的 worker 。
    在 rabbitmq web interface 上看 message 有没有被正常 consume 。
    julyclyde
        2
    julyclyde  
    OP
       2016-04-24 03:04:20 +08:00
    @calease 没 consume ;我的是 redis ,我看 len(events)越来越大
    calease
        3
    calease  
       2016-04-24 03:13:01 +08:00
    我记得 redis messages 是存在 celery 这个 key 里的吧,用 scard(celery)看 message 的数量。
    但我也从没遇过 worker 停止的问题。用-l DEBUG 看看?
    julyclyde
        4
    julyclyde  
    OP
       2016-04-24 09:05:31 +08:00
    @calease 不是 celery 这个 key 啊。消息是 kombu 处理的, kombu 哪儿认识谁是 celery 啊……
    zhouquanbest
        5
    zhouquanbest  
       2016-04-24 18:29:13 +08:00
    Celery 的坑找起来还是很麻烦的 你要是想先快速解决 再找慢慢找 bug 的话
    可以先配置下 celery worker 自杀 设定执行个千百次自杀重启好了
    在服务端很常见的解决方案
    julyclyde
        6
    julyclyde  
    OP
       2016-04-24 19:47:35 +08:00
    @zhouquanbest 我设置了 timelimit ,但没什么效果,所以我怀疑是 prefork 模式的 master 进程有问题
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3565 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 04:47 · PVG 12:47 · LAX 21:47 · JFK 00:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.