Celery Worker Database Connection Pooling

前端 未结 6 1009
萌比男神i
萌比男神i 2020-12-07 19:17

I am using Celery standalone (not within Django). I am planning to have one worker task type running on multiple physical machines. The task does the following

    <
6条回答
  •  离开以前
    2020-12-07 19:49

    Have one DB connection per worker process. Since celery itself maintains a pool of worker processes, your db connections will always be equal to the number of celery workers. Flip side, sort of, it will tie up db connection pooling to celery worker process management. But that should be fine given that GIL allows only one thread at a time in a process.

提交回复
热议问题