Celery Cloudamqp creates a new connection for each task

I am currently using nitrous.io running Django with Celery and then Cloudamqp as my free plan broker (max 3 connections). I can connect just fine and run a periodic task just fine.

When i started

    celery -A proj worker  -l info   

2 connections are created immediately on Cloudamqp, and I can manually create several tasks on the third connection, and everything is fine. However, when I run from celery with

    celery -A proj worker -B -l info

all 3 compounds are used, and if chopping celery creates 1 or more new tasks, another 4th compound will be created, which will overcome the maximum allowable compounds.

I tried and currently installed

    BROKER_POOL_LIMIT = 1

but this does not seem to limit the connections I also tried

    celery -A proj worker -B -l info
    celery -A proj worker -B -l info -c 1  
    celery -A proj worker -B -l info --autoscale=1,1  -c 1  

no luck.

, ? - 0 1 ?

+4

Source: https://habr.com/ru/post/1537745/


All Articles