?时间运?Celery有可能发?内存泄露,可以像下?这样设置
CELERYD_MAX_TASKS_PER_CHILD = 1000 # 每个worker执?了多少任务就会死掉
vi settings.py
CELERY_RESULT_BACKEND = 'django-db'
#CELERY_BROKER_URL = 'redis://10.1.102.232:6379/3'
CELERY_BROKER_URL = "sqla+sqlite:///" + os.path.join(BASE_DIR, 'celery.db') #数据库队列
CELERYD_MAX_TASKS_PER_CHILD = 100 # 每个worker执?了多少任务就会死掉
#CELERY_BROKER_URL = BROKER_URL = 'sqla+mysql://root:root@10.1.103.251/test'
CELERYD_CONCURRENCY = 8 # 设置并发的worker数量
CELERY_TIMEZONE = 'Asia/Shanghai'
CELERY_BEAT_SCHEDULER = 'django_celery_beat.schedulers:DatabaseScheduler' #启用数据库
阅读(304) | 评论(0) | 转发(0) |