djangoherokuceleryamqpcloudamqp

RabbitMQ keeps connections running for a long time


I am using a hosted RabbitMQ provider i.e CloudAMQP and running a django app server on heroku. In local environment everything seems to work fine but on Heroku where CloudAMQP has a limit on the number of simultaneous connections to the broker, the connections seem to persist forever eventually resulting in the app running out of available open connections. This happens even when the tasks associated with earlier connections have executed by the subscriber (i.e a heroku worker).

If you have been able to successfully use CloudAMQP with Heroku and django celery, can you post the things that worked for you?


Solution

  • Was able to fix this by adding BROKER_POOL_LIMIT=0 to my production settings.