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

celery worker 正常运行,但不消费任务,试了很多办法,解决不了。

  •  
  •   wuwukai007 · 2022-04-29 19:44:52 +08:00 · 2539 次点击
    这是一个创建于 721 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • celery worker 接收定时任务,worker 隔段时间就不消费了,任务主要是 django client 模拟访问
    • 设置了 任务超时时间 time_limit 和 redis socket_timeout 没有用
    • 参考了 这个文章 https://ayushshanker.com/celery-long-post/ 没有什么头绪。 worker 不打日志,进程存在,没有任何日志,beat 一直发任务,worker 没有反应
    3 条回复    2022-05-05 13:47:40 +08:00
    wd
        1
    wd  
       2022-04-29 19:45:16 +08:00 via iPhone
    你不看日志吗?
    cz5424
        2
    cz5424  
       2022-04-29 20:08:08 +08:00 via iPhone
    一般是任务里写了死循环
    julyclyde
        3
    julyclyde  
       2022-05-05 13:47:40 +08:00
    以前我是在函数各处写日志,把这个任务的 id 、执行到某个步骤、耗费的时间记录下来

    最后发现是在函数里访问 redis 的时候遭遇了 zset 性能问题……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1013 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:55 · PVG 06:55 · LAX 15:55 · JFK 18:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.