Skip to content
Advertisement

Celery –pool=threads — what does this do and how do I use it properly?

I’m hitting a segfault error while running a task using Celery. After looking up the issue, it seems others are solving similar issues by starting celery with --pool=threads.

When I try passing --pool=threads I get ModuleNotFoundError: No module named 'threads'

I don’t believe this is the same as the thread module which would throw the error of No module named 'thread' instead.

How do I start using threads and what does it do?

The documentation regarding --pool=threads in the Celery site is very sparse. Searching for “–pool” will return nothing substantial, other than things related to billiard

Advertisement

Answer

If you want to use threads as your execution pool, you can choose between eventlet an gevent.

http://docs.celeryproject.org/en/latest/reference/celery.bin.worker.html#cmdoption-celery-worker-p

You need to pip install eventlet/gevent to make it work.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement