1

当我启动 celeryd 并运行两三天时,每次总是占用非常高的 cpu(大约 100%)。

同时,任务的处理速度非常慢(20-30 秒)。

这是我的 celeryconfig.py:

BROKER_URL = "mongodb://mongodb_server:27017/celery"                                                                                                                                                        
CELERY_RESULT_BACKEND = "mongodb"                                                
CELERY_IMPORTS = ("cate.tasks",)                                                 

CELERY_SEND_TASK_ERROR_EMAILS = True                                             
ADMINS = (                                                                       
        ("...", "..."),                                             
    )                                                                            

SERVER_EMAIL = "dev-no-reply@ele.me"                                             

#ETA_CELERY_PRECISION = 0.1                                                      
#CELERY_DISABLE_RATE_LIMIT = True                                                
CELERY_MAX_TASKS_PER_CHILD = 1                                                   
CELERY_IGNORE_RESULT = True                                                      
CELERYD_PREFETCH_MULTIPLIER = 1                                                  
#CELERYD_FORCE_EXECV = True                                                      
CELERY_SEND_EVENTS = True                                                        

#CELERY_ENABLE_UTC = True                                                        
#CELERY_TIMEZONE = "Asia/Shanghai"                                               

CELERY_ROUTES = {"cate.tasks.push_ios_message": {"queue": "push_ios_message"}}
4

0 回答 0