Celery支持不同的並發和序列化的手段 並發:Prefork, Eventlet, gevent, threads/single threaded 序列化:pickle, json, yaml, msgpack. zlib, bzip2 compression, Cryptographic message signing 等等 默認是進程池方式,進程數以當前機器的CPU核數為參考,每個CPU開四個進程。 如何自己指定進程數: celery worker -A proj --concurrency=4 如何改變進程池方式為協程方式: celery worker -A proj --concurrency=1000 -P eventlet -c 1000 # 安裝eventlet模塊 $ pip install eventlet # 啟用 Eventlet 池 $ celery -A celery_tasks.main worker -l info -P eventlet -c 1000 https://www.cnblogs.com/yuanfang0903/p/13518236.html https://docs.celeryproject.org/en/v4.4.6/reference/celery.bin.worker.html#cmdoption-celery-worker-c https://docs.celeryproject.org/en/v4.4.6/userguide/concurrency/eventlet.html#concurrency-eventlet
