Search code examples
multithreadingconcurrencycelerycelery-taskceleryd

How can we see the threads in Celery?


I am trying to set a different number of concurrent threads in Celery using --concurrency=1 (based on Workers Guide).

Anyway, when I run the daemon (celeryd ... --concurrency=1) I don't know how to see the number of threads that are running.

Do they correspond to each line shown in ps -ef?


Solution

  • By default celery uses subprocesses for the workers. If you configure concurrency=1 you should have 2 processes:

    • the main process that consumes messages from the broker and manages the process poll
    • 1 worker process

    In general you will have 1 main process + N worker subprocesses, as many as stated in --concurrency=N or CELERYD_CONCURRENCY=N

    I'm not sure what happens with gevent workers.