WebFaction
Community site: login faq

I have installed o django-celery + RabbitMQ. I am using django-supervisor for daemonization.

  • Even when I restart apache, everything works normally.

  • But after a few hours I see that django-supervisor is not running.

I go to the directory and do:

] $ Python2.7 manage.py supervisor status

Output:

] $ http://127.0.0.1:9490 connection refused

And then, I need to start it in daemon mode again, using command.

python2.7 manage.py supervisor - daemonize

and works!!!!

So why django-supervisor is stopping, even though I set it to run in daemon mode?

**====file supervisord.conf========**

[program:celeryd]

command=python2.7 {{ PROJECT_DIR }}/manage.py celeryd -l info

[program:celerybeat]

command= python2.7 {{ PROJECT_DIR }}/manage.py celerybeat --schedule=/home/lcnleal/celery-run/celerybeat-schedule --loglevel=INFO

[program:autoreload]

exclude=true

[program:runserver]

exclude=true

asked 03 Aug '12, 00:29

lcnleal
324
accept rate: 0%

edited 03 Aug '12, 01:01

ryans ♦♦
5.0k103760


Looking through our logs on the server, it looks like your processes are being terminated for exceeding the account's memory usage. Your cron job then restarts your Django instance a bit later, which is why it looks like only supervisor stopped running.

permanent link

answered 03 Aug '12, 01:04

ryans ♦♦
5.0k103760
accept rate: 43%

Really, with supervisor running I have an increase in memory consumption from 122MB to 197MB (LIMIT 256MB). However, I can not know which value reached when exceeding ?

Every time you restart Django instance, I'm also having problems to run the celery programs. After a time this problem disappears. Here's what occurs, debugging o celery:


[2012-08-03 01:49:18,804: ERROR/Beat] Celerybeat: Connection error: [Errno 111] Connection refused. Trying again in 2.0 seconds...

[2012-08-03 01:49:20,523: ERROR/MainProcess] Consumer: Connection Error: [Errno 111] Connection refused. Trying again in 4 seconds...

[2012-08-03 01:49:20,804: ERROR/Beat] Celerybeat: Connection error: [Errno 111] Connection refused. Trying again in 4.0 seconds...

[2012-08-03 01:49:24,526: ERROR/MainProcess] Consumer: Connection Error: [Errno 111] Connection refused. Trying again in 6 seconds...

[2012-08-03 01:49:24,806: ERROR/Beat] Celerybeat: Connection error: [Errno 111] Connection refused. Trying again in 6.0 seconds...

[2012-08-03 01:49:30,526: ERROR/MainProcess] Consumer: Connection Error: [Errno 111] Connection refused. Trying again in 8 seconds...

[2012-08-03 01:49:30,806: ERROR/Beat] Celerybeat: Connection error: [Errno 111] Connection refused. Trying again in 8.0 seconds...


(03 Aug '12, 01:50) lcnleal

Sure, we can tell you the value reached when it exceeded - this is in our logs; just open a support ticket and we can give you the numbers.

With respect to Celery, it's expected that there will be issues after all your processes are terminated and you restart Django via a cron job. I think once your memory usage is under control (or raise your memory limit) this issue may resolve itself.

(03 Aug '12, 03:44) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×12
×10
×3
×1

question asked: 03 Aug '12, 00:29

question was seen: 5,720 times

last updated: 03 Aug '12, 03:44

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM