Supervisor+celery+redis+gevent appears missed Hearbeat

Source: Internet
Author: User
Tags redis

One: Problem Description:
Using supervisor to manage the celery process, the broker uses Redis, and the Gevent pool runs Task,celery uses a version of 4.0.2, randomly appearing missed hearbeat worker, running normally after restarting the process
Workaround:
1. Set the heartbeat packet check interval and the length of time, so as to ensure that due to system load causes detection is not allowed, because the check mechanism is to send a message to the queue, the worker can receive this message, if the system does not work, it may take a long time, if the interval is not set, It may be thought that the worker was lost.
Set the parameters as follows:
Broker_heartbeat = 24 * 60 * 60
broker_heartbeat_checkrate = Int (BROKER_HEARTBEAT/60 * 60)

2. Set the maximum runtime length for each task. If the task runs longer than the time, the task is actively ended, so that all resources in the pool are not consumed, and the exception task is terminated as soon as possible to improve processing speed.
Set the parameters as follows:
Task_time_limit = 1 * 60 (can be modified according to the desired run time of your task)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.