Celery - run different workers on one server

前端 未结 4 596
时光取名叫无心
时光取名叫无心 2021-01-29 22:33

I have 2 kind of tasks : Type1 - A few of high priority small tasks. Type2 - Lot of heavy tasks with lower priority.

Initially i had simple configuration with default ro

4条回答
  •  孤城傲影
    2021-01-29 23:08

    An update:

    In Celery 4.x, below would work properly:

    celery multi start 2 -Q:1 celery -Q:2 starters -A $proj_name

    Or if you want to designate instance's name, you could:

    celery multi start name1 name2 -Q:name1 celery -Q:name2 queue_name -A $proj_name

    However, I find it would not print details logs on screen then if we use celery multi since it seems only a script shortcut to boot up these instances.

    I guess it would also work if we start these instances one by one manually by giving them different node names but -A the same $proj_name though it's a bit of a wasting of time.

    Btw, according to the official document, you could kill all celery workers simply by:

    ps auxww | grep 'celery worker' | awk '{print $2}' | xargs kill -9

提交回复
热议问题