Abdul Majeed
Abdul Majeed

Reputation: 2781

Python Django Celery is taking too much memory

I am running a celery server which have 5,6 task to run periodically. Celery is taking too much memory after 5,6 days of continuous execution.

Celery documentation is very confusing. I am using following settings.

# celeryconfig.py
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'xxx.settings'
# default RabbitMQ broker
BROKER_URL = "amqp://guest:guest@localhost:5672//"

from celery.schedules import crontab
# default RabbitMQ backend
CELERY_RESULT_BACKEND = None

#4 CONCURRENT proccesess are running.
CELERYD_CONCURRENCY = 4

# specify location of log files
CELERYD_LOG_FILE="/var/log/celery/celery.log"

CELERY_ALWAYS_EAGER = True

CELERY_IMPORTS = (
    'xxx.celerydir.cron_tasks.deprov_cron_script',

                )

CELERYBEAT_SCHEDULE = {
    'deprov_cron_script': {
    'task': 'xxx.celerydir.cron_tasks.deprov_cron_script.check_deprovision_vms',
    'schedule': crontab(minute=0, hour=17),
    'args': ''
    }
}

I am running celery service using nohup command(this will run this in background).

 nohup celery beat -A xxx.celerydir &

Upvotes: 0

Views: 3208

Answers (1)

Abdul Majeed
Abdul Majeed

Reputation: 2781

After going through documentation. I came to know that DEBUG was True in settings.

Just change value of DEBUG in settings.

REF:https://github.com/celery/celery/issues/2927

Upvotes: 1

Related Questions