I have a Django app that I've already deployed to Heroku. This app uses Celery for message queuing and I've run it locally using RabbitMQ without incident.
Unfortunately, when I went to deploy this baby to Heroku, I found that the RabbitMQ addon wasn't available and that I'd have to use CloudAMQP. The documentation for both CloudAMQP and Heroku lead me to believe that I can use Celery (even though they recommend Pika), but when I try to deploy, I get gnarly connection errors for both my scheduler and worker processes. Here are the exact errors:
2012-07-09T16:46:22+00:00 app[scheduler.1]: [2012-07-09 11:46:22,234: ERROR/Beat] Celerybeat: Connection error: [Errno 111] Connection refused. Trying again in 2.0 seconds...
2012-07-09T16:46:23+00:00 app[worker.1]: [2012-07-09 11:46:23,852: ERROR/MainProcess] Consumer: Connection Error: [Errno 111] Connection refused. Trying again in 2 seconds...
I should note that my Heroku config vars DO have a CLOUDAMQP_URL, so that shouldn't be a problem?
I would appreciate it if anyone who has used CloudAMQP with Django/Heroku could give me some guidance about how to make sure that Celery can connect with the broker.
You're probably exceeding the 3 concurrent connections limit of the free plan. Set the BROKER_POOL_LIMIT to 1 and it should work a lot better.
Make sure that you have this at the top of your settings.py
file.
import djcelery
djcelery.setup_loader()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With