【问题标题】:Why does celery works with "--concurrency 1 -P solo" and not without?为什么 celery 可以使用“--concurrency 1 -P solo”而不是没有?
【发布时间】:2021-09-12 11:56:30
【问题描述】:

当我使用时:

celery -A FAM worker -l info --concurrency 1 -P solo

我可以从 celery 运行我的任务。

当我使用时:

celery -A FAM worker -l info

它不起作用。但我不明白为什么。我看到有区别:“16(prefork)”与“1(solo)”。有什么区别 ?为什么独奏有效而其他无效?

【问题讨论】:

    标签: django redis django-views celery


    【解决方案1】:

    问题是 Celery 从版本 4 开始不支持 Windows,因此在 Windows 上运行它可能会出现问题。与并发一样。

    基于 article 我可以使用 Eventlet 解决这个问题。

    pip install eventlet
    

    当启动 celery worker 时:

    celery -A FAM worker -l info --concurrency 4 -P eventlet
    

    【讨论】:

      猜你喜欢
      • 2012-02-23
      • 2022-01-14
      • 2010-12-09
      • 2018-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-12
      • 1970-01-01
      相关资源
      最近更新 更多