Implement Lightweight Health Check for Celery Worker in Kubernetes #5332

Closed
opened 2026-02-21 18:10:28 -05:00 by yindo · 0 comments
Owner

Originally created by @Seayon on GitHub (Sep 1, 2024).

Originally assigned to: @Seayon on GitHub.

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Background

We deploy Dify with a worker mode based on Celery. In Kubernetes, we require a health check mechanism for these workers.

Current Problem

The standard Celery health check method uses the celery inspect ping command:

celery inspect ping -d celery@$(hostname) | grep -q OK

This approach consumes significant resources, which is problematic in production environments. This issue is also recognized within the Celery community.

[K8S] livenessProbe and readinessProbe for celery beat and workers

But, Inspired by Health checks for Celery in kubernetes I've implemented a check script that works effectively. The script uses file-based checks to determine the worker's readiness and liveness.

Alternatively, please provide other possible implementations to help us deploy easily in k8s.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @Seayon on GitHub (Sep 1, 2024). Originally assigned to: @Seayon on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. ## Background We deploy Dify with a worker mode based on Celery. In Kubernetes, we require a health check mechanism for these workers. ## Current Problem The standard Celery health check method uses the `celery inspect ping` command: ```shell celery inspect ping -d celery@$(hostname) | grep -q OK ``` This approach consumes significant resources, which is problematic in production environments. This issue is also recognized within the Celery community. [[K8S] livenessProbe and readinessProbe for celery beat and workers](https://github.com/celery/celery/issues/4079) But, Inspired by [Health checks for Celery in kubernetes](https://medium.com/ambient-innovation/health-checks-for-celery-in-kubernetes-cf3274a3e106) I've implemented a check script that works effectively. The script uses file-based checks to determine the worker's readiness and liveness. Alternatively, please provide other possible implementations to help us deploy easily in k8s. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:10:28 -05:00
yindo closed this issue 2026-02-21 18:10:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5332